2012-12-17 189 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控制器 - >嵌入在 - >导航控制器