2012年1月24日 星期二

用presentModalViewController跳到另一個畫面

//如果是要從一個畫面(nib)跳到另一個畫面的方法,須指定要跳到的畫面,在這裡就是storeInfoViewController

- (IBAction)gotoStoreInfo:(id)sender {
    storeInfoViewController *storeView = [[storeInfoViewController alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:storeView animated:YES];
}

//如果要回到剛才跳回來的畫面, 不需要指定要回到的畫面,反正它會自已回到剛才來的地方

- (IBAction)backToMenu:(id)sender {
    menuViewController *menuView = [[menuViewController alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:menuView animated:YES];
}


0 意見:

張貼留言