首先,我嘗試了所有賽格瑞代碼,但不正確的結果......的TableView數據傳遞給其他的tableView和導航控制器
(的iOS 7)我的故事板與標籤欄開始,有一個按鈕型號 - >與導航控制器的表視圖。該TableView具有JSON數據。如果單擊一個單元格,並通過push segue傳遞給另一個tableViewController。 我推代碼:
KatAltViewController * ilet = [[KatAltViewController alloc] init];
Kategoriler * currentKategoriler = [kategorilerArray objectAtIndex:indexPath.row];
ilet.cid = currentKategoriler.cid;
[self.navigationController pushViewController:ilet animated:YES];
第一的tableView有沒有問題,但如果你點擊第二個表視圖中的單元格,控制檯給出了錯誤:
2013-12-23 17:08:59.871 project02[3903:70b] nested push animation can result in corrupted navigation bar
2013-12-23 17:09:00.238 project02[3903:70b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
所以,我點擊後退按鈕,在第二個實現代碼如下:屏幕是黑色的!
2013-12-23 17:10:34.081 project02[3903:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add self as subview'
我該如何解決這個問題?
您是否還有附加到按鈕或表視圖單元格的segues?如果它是故事板中的一個場景,則不應該使用alloc init來獲取KatAltViewController的實例。你應該使用instantiateViewControllerWithIdentifier:或使用segue。 – rdelmar