私はiPhone開発者の初心者ですが、
アプリケーションに4
ページがあります。アプリケーションはviewBasedApplication
です。
最初のページ( LicAppViewController
)を としてRootViewController
作成しました。これが私のコードです。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewController = [[[LicAppViewController alloc] initWithNibName:@"LicAppViewController" bundle:nil] autorelease];
UINavigationController *navigationController=[[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}
ボタンをクリックすると、2ページ目に移動します( PlanPage
)
-(void)btnClicked{
PlanPage *viewController = [[PlanPage alloc]initWithNibName:@"PlanPage" bundle:nil];
[UIView beginAnimations:@"Flip" context:nil];
[UIView setAnimationDuration:0.7];
[UIView setAnimationCurve:UIViewAnimationOptionCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[self.navigationController pushViewController:viewController animated:YES];
[UIView commitAnimations];
[viewController release];
}
今までは問題なく動作していましたが、2 ページ目の行を選択するとアプリケーションがクラッシュし、3 ページ目 ( DetailPlanPage
) に移動したいのですが、これが私のコードです
DetailPlanPage *nextController = [[DetailPlanPage alloc] initWithNibName:@"DetailPlanPage" bundle:nil];
[self.navigationController presentModalViewController:nextController animated:TRUE];
しかし、私が書くとき、この行:
[self.navigationController pushViewController:nextController animated:YES];
それ以外の:
[self.navigationController presentModalViewController:nextController animated:TRUE];
それはうまくいっています。(よくわかりませんが、アプリケーションのクラッシュは viewBased Application が原因である可能性があります)
前もって感謝します !