iOS的接口定义属性根本就没有权限的定义
那我要定义一个私有的属性怎办?
解决方案
可以将@property定义写在.m文件中的类扩展(class extension)中,
例如,"MyClass.h"如下
@interface MyClass : NSObject@end
在"MyClass.m"里可以这么写:
#import "MyClass.h"@interface MyClass ()@property (nonatomic, assign) BOOL foo;@end@implementation MyClass@synthesize foo = _foo; //XCode 4.4之后,这行可以省略@end
详情可以参见官方文档
http://developer.apple.com/library/io...