我在表格视图中添加了一个 UINavigationBar。我知道这不是正确的方法,但我在想还有其他方法吗?当我试图将 UINavigationBar 和表视图放在视图控制器或表视图控制器中时,控制台会出现此错误:
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>.'
现在,当我滚动时,导航栏会随着表格视图移动。有什么办法可以将其锁定在顶部吗?或者修复上面的错误...