#import <Foundation/Foundation.h> /** * 1.給私有方法的名稱加上前綴,這樣容易和公共方法區別開 * 2.不要單用一個下劃線作私有方法的前綴,由於這種作法是預留給蘋果公司的 */ @interface EOCObject : NSObject +(void)classPublicMethod; -(void)pulicMethod; @end #import "EOCObject.h" @implementation EOCObject +(void)classPublicMethod { } -(void)pulicMethod { EOCObject *obj = [EOCObject new]; [obj p_privateMethod]; } -(void)p_privateMethod { } @end