Private methods in Objective-C
In Objective-C there are compiler directives for instance variables: @private, @protected and @public but you can't use it for your methods. If you wan't to hide some methods you can use it like this :Â
File Test.h : Â
@interface Test : ObjectÂ
+(void) classMethod {}Â
-(void) instanceMethod{}Â
@endÂ
File Test.mÂ
#import "Test.h"Â
@interface Test (hidden)Â
+(void) hiddenClassMethod;Â
-(void) hiddenInstanceMethod; Â
@end Â
@implementation Test (hidden)Â
+(void) hiddenClassMethod {} Â
-(void) hiddenInstanceMethod {}Â
@end Â
@implementation Test Â
+(void) classMethod {}Â
-(void) instanceMethod{}Â
@end













