というプログラムを組みたいと思っています。
ですが、何故か画面遷移する前に遷移先のviewDidLoadの処理を終らせてしまい、その後遷移するといった奇妙な挙動をするようになってしまいました。
原因を知りたいです。
お願いします。
► スポイラーを表示
- (void)RE {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"更新確認"
message:@"更新してもよろしいですか?"
delegate:self
cancelButtonTitle:@"はい"
otherButtonTitles:@"いいえ", nil];
[alert show];
}
// アラートのボタンが押された時に呼ばれるデリゲート例文
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:{
//1番目のボタンが押されたときの処理を記述する
NSLog(@"開始");
[self load];
NSLog(@"終了");
break;
}
case 1:{
//2番目のボタンが押されたときの処理を記述する
break;
}
}
}
- (void)load {
LoadingViewController *load = [self.storyboard instantiateViewControllerWithIdentifier:@"toLoad"];
//画面遷移する
[self.navigationController pushViewController:load animated:YES];
}