I've noticed a variety of @interface
declarations for Objective-c classes. I'd like to understand why developers declare @interface
in the following ways:
// 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
See Question&Answers more detail:os