我正在使用故事板,并希望为我的UITableView实现一个UISearchbar.UISearchbarController生成一个新的UITableView,我使用以下策略:
if (tableView == self.tableView)
//Populate table view with normal data
else
//Populate table view with search data
Run Code Online (Sandbox Code Playgroud)
第一个问题是处理自定义单元格.我必须在cellForRowAtIndexPath中实例化它们.通常你会从一个nib文件中做到这一点.我如何使用故事板进行此操作?dequeueReusableCellWithIdentifier返回nil.
第二个问题涉及从表视图到详细视图的segue.segue在普通表视图中启动,但不在搜索表视图中启动.由于故事板隐藏了一切,我不知道如何将segue分配给搜索表视图的单元格.
有人可以帮忙吗?谢谢!