2013-10-29

How to declare private function in Objective-C


inside .m file, add @interface declaration


#import “MyClass.h”
@interface MyClass()
- (void) doMyPrivateFunction;
- (int) getMyMagicNumber;
@end

@implementation MyClass
….. 
@end

so that the function will be private.

沒有留言:

張貼留言