0
我正在迁移应用程序以与ios8兼容。viewWillAppear正在运行,即使viewDidLoad执行Segue
为什么viewWillAppear块在viewDidLoad执行segue时运行?它不在ios7中发生。
- (void)viewDidLoad
{
[super viewDidLoad];
[self performSegueWithIdentifier:@"showLogin" sender:self];
}
-(void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
PFUser *currentUser = [PFUser currentUser];
// crashes here when not currentUser:
NSLog(@"Logged user: %@ my_api_id=%@", currentUser.username, currentUser[@"api_id"]);
}