阅读背景:

不能在objective c中找到协议声明。

来源:互联网 
#import <Foundation/Foundation.h>
@interface dog:NSObject<logging>{
@private
int age;
}
@property int age;

@end
@implementation dog
@synthesize age;
-(void)log{
NSLog(@" this is a god having age %d ",age);
}
@end
@protocol logging
-(void)log;
@end
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
dog *loop=[[dog alloc] init];
//[dog setAge:6];
[dog log];
[pool drain];
return 0;
}
#import <Foundation/Foundation.h>
@interface do



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: