2012-12-17 94 views
0

I have added a UINavigationBar in the Table view.我知道這不是正確的做法,但即時思考還有其他方法嗎?當我滾動,用表視圖導航欄移動將UINavigationBar添加到UITableView

Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', 
reason: 'A view can only be associated with at most one view controller at a time! 
View <UITableView: 0x1ebfb200; frame = (0 0; 320 480); clipsToBounds = YES; opaque 
= NO; autoresize = W+H; gestureRecognizers = <NSArray: 0x1e5a0500>; layer = 
<CALayer:0x1e5a94f0>; contentOffset: {0, 0}> is associated with <UITableViewController: 0x1e59f8c0>. 
Clear this association before associating this view with <SheetsSavedViewController: 0x1f879660>.' 

現在:當我嘗試把UINavigationBar的並表視圖在視圖控制器或表視圖控制器的控制檯,這個錯誤。有沒有辦法將它鎖定在頂部?或者修復上述錯誤...

+0

這裏有一個很好的教程:http://dlinsin.blogspot.it/2010/01/adding- uinavigationbar-to-uitableview.html我建議從頭開始。 –

回答

0

爲什麼不使用文件菜單中的菜單選項將整個表格視圖控制器嵌入到導航視圖中。

0
  • 選擇stroyboard
  • 編輯您的tableView控制器 - >嵌入在 - >導航控制器