2010-04-05 72 views
0

我的應用程序由一個橫向視圖組成,我想放置一個模態視圖,但問題與模態視圖有關。它沒有得到它的負載..代碼是:在iphone中在橫向模式下顯示modalviewcontroller的問題?

-------------------- code here ---------- ------------

UIViewController * modalViewController = [[UIViewController alloc] init];

modalViewController.view = modelView1; [self presentModalViewController:modalViewController animated:NO];

[self performSelector:@selector(hideSplash)withObject:nil afterDelay:5.0];


PLZ好心幫我這個....

回答

1

與我們的代碼的問題,就是你與alloc-init初始化它,而沒有任何筆尖的名字。現在,當調用:

[self presentModalViewController:modalViewController animated:NO]; 

該視圖將通過調用它的loadview方法加載本身,你一定沒有。所以如果u確實想以同樣的方式進行初始化,只是試運行的代碼行:

modalViewController.view = modelView1; 

後:

[self presentModalViewController:modalViewController animated:NO]; 

,如:

[self presentModalViewController:modalViewController animated:NO]; 
modalViewController.view = modelView1; 

我認爲這將然後工作。

希望這會有所幫助。

感謝,

madhup

+0

thanx的答覆,但它在這兩個工作的方式得到了一個差異。問題。 – abhiTouchmagic 2010-04-07 07:43:30

相關問題