當試圖添加新視圖時遇到了這個非常令人沮喪的問題,我有兩種不同類型的視圖:LargeCoverViewController
和CoverViewController
。initWithNibName不起作用
我創建了一個LargeCoverViewController
這樣的:
LargeCoverViewController *tmpCover = [[LargeCoverViewController alloc] initWithNibName:@"LargeCoverViewController" bundle:nil andIssue:issue];
這只是工作,但是當我嘗試創建一個CoverViewController
,它拒絕工作
CoverViewController *tmpCover = [[CoverViewController alloc] initWithNibName:@"CoverViewController" bundle:nil andIssue:issue];
我想它有話用.xib文件做,當我這樣做的時候它再次「起作用」
CoverViewController *tmpCover = [[CoverViewController alloc] initWithNibName:@"LargeCoverViewController" bundle:nil andIssue:issue];
在Interface Builder中,類設置正確,我的視圖正確鏈接。 (它基本上只是LargeCoverViewController的一個副本),我還錯過了什麼嗎? 它變得非常令人沮喪......
編輯: 我的應用程序不會崩潰,如果我的nibname錯誤,應用程序應該崩潰,這不是這裏的情況。
拒絕工作?我敢打賭,這不是你收到的錯誤信息?問題是什麼? – Rog
@Rog,Jup,它拒絕工作,沒有任何事情發生,我的觀點仍然是空的。 viewDidLoad被調用,只是沒有顯示。 –