if
だから私は、にプッシュするステートメントでこのボタンを取得しましたStartViewController
。遷移が行われたかどうかを確認するために、このビューコントローラーNSLog@"transition successful"
のを作成しました。viewDidLoad
ログでは移行が成功したことを示していますが、画面では移行が行われていません。
コードは次のとおりです。
-(IBAction)initialButton:(id)sender {
NSLog(@"initialButton clicked");
if([userEmail.text length] <4)
{
[WCAlertView showAlertWithTitle:@"Email is empty" message:@"You haven't entered an email yet. Please enter one so we can sent you the shipping labels." customizationBlock:^(WCAlertView *alertView) {
alertView.style = WCAlertViewStyleBlackHatched;
} completionBlock:^(NSUInteger buttonIndex, WCAlertView *alertView) {
if (buttonIndex == 0) {
NSLog(@"Cancel");
} else {
NSLog(@"Ok");
}
} cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
}
else
{
StartViewController *startViewController = [[StartViewController alloc] init];
self.transitionController = [[[TransitionController alloc] initWithViewController:startViewController] initWithNibName:@"StartViewController" bundle:nil];
[initialViewController.view removeFromSuperview];
self.window.rootViewController = self.startViewController;
}
}
ここにログがあります:
2012-12-14 09:22:55.431 Janssenpakketapp[24165:c07] initialViewController loaded
2012-12-14 09:23:04.021 Janssenpakketapp[24165:c07] initialButton clicked
2012-12-14 09:23:06.116 Janssenpakketapp[24165:c07] Ok
2012-12-14 09:23:11.909 Janssenpakketapp[24165:c07] initialButton clicked
2012-12-14 09:23:11.911 Janssenpakketapp[24165:c07] transition succesful