2013-05-13 23 views
0

我有一個教程,並在本教程結束時我想從UIViewController推到UINavigationViewController。我需要UINavigationViewController,因爲我使用的是ECSlidingViewController。這個由UINavigationViewController管理的視圖是一個UITableViewController。到目前爲止,一切都很容易理解的權利?沒問題。但現在它變得很奇怪。 現在我用這個代碼(IBAction爲):Segue從NavigationBarItem到UINavigationViewController

HomeNavViewController *home = [[HomeNavViewController alloc] init]; 
[self presentModalViewControllerhome animated:YES]; 

一切我得到的是來自調試器的應用程序終止。 有沒有人已經經歷過這個?

預先感謝任何幫助:)

以下是錯誤消息(對不起,我忘了將它張貼在首位:)):

2013-05-14 16:43:07.313 187ers[1124:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' 
*** First throw call stack: 
(0x2c3e012 0x210be7e 0x2bf1b6a 0x2bf1a20 0x2aca3f 0xeac4 0x340103 0x34042b 0x34df80 0x54a223 0x346ee3 0x347167 0x3471a7 0xe4cc 0x211f705 0x2602c0 0x49ca64 0x211f705 0x2602c0 0x260258 0x321021 0x32157f 0x3206e8 0x28fcef 0x28ff02 0x26dd4a 0x25f698 0x2b99df9 0x2b99ad0 0x2bb3bf5 0x2bb3962 0x2be4bb6 0x2be3f44 0x2be3e1b 0x2b987e3 0x2b98668 0x25cffc 0x2e4d 0x2d75) 
libc++abi.dylib: terminate called throwing an exception 
(lldb) 
+1

你能發佈錯誤信息嗎? – danypata 2013-05-13 19:19:49

+0

完成。對不起,我忘了發佈 – 2013-05-14 14:45:20

回答

0

你的錯誤是由非法所致在NSMutableArray上操作(你嘗試在NSMutableArray中插入一個零對象)。檢查你的代碼HomeNavViewController`viewDidLoad中/ viewWillAppear中/ viewDidAppear(如果實現它們),並確保你不嘗試,如果你同樣的問題後[self presentModalViewControllerhome animated:YES];檢查執行代碼中插入零對象到一個數組

而且插入零對象轉換成NSMutableArray。

+0

我沒有數組:/ – 2013-05-14 14:53:51

+0

你應該例外的breackpoint看看哪一行導致崩潰。 – danypata 2013-05-14 14:58:32