Tuesday, 6 August 2013

Objective-c -method in implementation only and extension class's method, what's the difference

Objective-c -method in implementation only and extension class's method,
what's the difference

I'm an objective-c beginner, and i saw code like below:
DemoController.m:
@interface DemoController()
-(void)method1;
@end
@implementation DemoController
-(void)method1
{
NSLog(@"This is method1 in class extension");
}
//this method is not declared in DemoController.h, only in DemoController.m.
-(void)method2
{
NSLog(@"This is method2 in implementation only");
}
@end
I want to know what is the difference between method1 and method2. Could
anyone kindly tell me?
Sincerely, Huang

No comments:

Post a Comment