#import "Person.h"
@implementation Person
- (void)run
{
Person *p1 = [Person new];
[p1 test];
// 能用self访问
[self test];
NSLog(@"人在走");
}
// test方法,没有在.h文件中声明,在.m中实现了
// 不能够被子类继承
- (void)test
{
NSLog(@"xxxxtest");
}
@end
object-c中私有方法
最新推荐文章于 2017-02-07 15:53:21 发布