- (void)viewDidLoad
{
[super viewDidLoad];
//llvm编译器最后添加release,立即dealloc
{
Person *p1 = [[Person alloc] init];
}
NSLog(@"%s",__func__);
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSLog(@"%s",__func__);
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSLog(@"%s",__func__);
}
//结果:
2018-08-06 11:03:50.250280+0800 testDemo[51033:20420488] -[Person dealloc]
2018-08-06 11:03:50.250416+0800 testDemo[51033:20420488] -[ViewController viewDidLoad]
2018-08-06 11:03:50.250773+0800 testDemo[51033:20420488] -[ViewController viewWillAppear:]
2018-08-06 11:03:50.253934+0800 testDemo[51033:20420488] -[ViewController viewDidAppear:]
网友评论