ZT Objective C入門詩、iPhoneプログラム構造
4180 ワード
C
C++,
objective-c,
C
C
C
[@begincommand] | @end
@interface classname
@implementation classname
@protocol interfacename
,
public / protected / private
,
,
:
:( )
,
,
NSObject
NSObject protocol
java
@interface CClassA(Category)|@end
@implementation CClassA (Category)|@end
Category
[CInheritClass poseAsClass: [CBaseClass class]];
:
@interface CClassA(Category): CBaseClass<IA,IB...>
, ,
C++
dll
,
,
,
CClassName* pA = [[CClassName alloc] init];
[pA autorelease];
[pA release];
init
int nRtn = [pA method:param1];
int nRtn = [CClassName method];
C pA->m_nCount = 1;
, id
id cur = sq;
id<IA> cur = sq;