在最新版本的xCode(4.3)中,我发现了预定义模板(例如Master/Detail模板),其中界面声明是在.m文件中完成的。例如,在文件MyFile.h中有:
@interface MyFile
@property (nonatomic, retain) NSString *someProp;
@end
在 MyFile.m 文件中有以下内容:
@implementation MyFile
@interface MyFile {
NSString * anotherProp;
}
- (id) init...
为什么要这样制作?为什么MyFile.h文件中没有声明anotherProp?
提前致谢。
@interface MyFile () { NSString * anotherPropt } @end @implementation MyFile - (id) init {...
如果是这种情况,请参考:https://dev59.com/rmkw5IYBdhLWcg3woMFD - jscs