2013-10-11 23 views

回答

1

試試這個下面的代碼:

SecondVC *detailView = [[SecondVC alloc] initWithNibName:@"SecondVC" bundle:nil]; 
[self.navigationController pushViewController:detailView animated:YES]; 
[detailView release]; 
+0

Thnaks你!它正在工作。並感謝你的stackoverflow團隊這樣的網站,這是真正的信息網站。 5星級兄弟.. !!! – Indra

+0

請告訴我,如何接受anwser .. !! – Indra

+0

標記現在看;) – Indra

0

使用方式如下:

.h文件中

#import "SecondViewController.h" 

.m文件

- (IBAction)gotoSecondView:(id) sender 
    { 
     NSLog(@"I am going to Second View"); 
     SecondViewController *SecondView = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil]; 

    [self.navigationController pushViewController:SecondView animated:YES]; 

    [SecondView release]; 
    } 

對於故事板:

SecondViewController* SecondView = [self.storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"]; 
[self presentModalViewController:SecondView animated:YES]; 
相關問題