【发布时间】:2012-11-20 10:34:38
【问题描述】:
我正在尝试使用以下代码以编程方式从视图控制器转换到表视图控制器(与情节提要 segue 相比):
[self.navigationController pushViewController:photosTVC animated:YES];
但是,当表格视图控制器正在加载时,我得到一个“断言错误”;具体来说,在这个方法的第二行:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Photo";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
...
表格视图控制器在使用 segue 转换到它时加载正常,但当我以这种方式转换时就不行了。任何我可以尝试的想法都将不胜感激!
感谢阅读。
编辑:完整的错误文本如下:
-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] 中的断言失败,/SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:4460
【问题讨论】:
-
完整的错误是什么?
标签: iphone ios segue pushviewcontroller