【发布时间】:2011-10-12 18:44:58
【问题描述】:
我注意到针对 Objective-c 类的各种 @interface 声明。我想了解为什么开发者会通过以下方式声明@interface:
// in the .h file
@interface MyClass : NSObject
// ...
@end
// in the .m file (what's the purpose of the parens?)
@interface MyClass ()
// more property declarations which seem like they can go in the .h file
@end
// again in the .m file (what's the purpose of private?)
@interface MyClass (Private)
// some method declarations
@end
【问题讨论】:
标签: objective-c interface class-design