From all code I've seen, almost always is used something like this for property scope definition:
Class extension
/*We declare the class extension*/
@interface MyClass ()
@property (nonatomic, retain) Type *aPrivateProperty;
- (void)aPrivateMethod;
@end
/*
We can use the main implementation block to implement our properties
and methods declared in the class extension.
*/
@implementation MyClass
/*Therefore we can use synthesize ;-)*/
@synthesize aPrivateProperty;
- (void)aPrivateMethod {
//Some code there
}
@end
But this is (from what I've seen) rarely used:
@interface MyClass : NSObject {
iVar *aProtectedIVar;
@public
iVar *aPublicIVar;
iVar *aSecondPublicIVar;
@protected
iVar *aSecondProtectedIVar;
@private
iVar *aPrivateIVAr;
}
@end
Why modifiers like @private, @protected and @public are not used so much in Objective-C if they are available?