【发布时间】:2011-10-27 16:23:58
【问题描述】:
我在 Xcode 中启动了一个 TabBar 应用程序。然后我添加了一个称为搜索的选项卡。然后我用名为 SearchController 的 XIB 文件创建了一个 UITableViewController。在 MainWindows.xib 中,我将第三个选项卡链接到 XIB 文件“SearchController”。
我为 UISearchBar 创建了 IBOutlet。在 Interface Builder 中,我添加了 UISearchBar,当我运行项目时一切正常,但是当我尝试将 UISearchBar 绑定到我的 IBOutlet 时,当我单击“搜索”选项卡时它引发了异常:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITableViewController 0x4e3ee80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key searchBar.'
*** Call stack at first throw:"
【问题讨论】:
标签: iphone objective-c uitableview uisearchbar xib