我是一个objective-c初学者,我看到了如下代码:
演示控制器.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
我想知道method1和method2有什么区别。谁能告诉我?
真诚的,黄