Iphone ios 5原型单元和画外音问题

Iphone ios 5原型单元和画外音问题,iphone,ios,ipad,ios5,Iphone,Ios,Ipad,Ios5,当画外音打开时,我在尝试加载原型单元时遇到问题。应用程序崩溃,我得到了错误 Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell

当画外音打开时,我在尝试加载原型单元时遇到问题。应用程序崩溃,我得到了错误

Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:]

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'

这只在VoiceOver打开时发生,否则应用程序运行正常。有什么帮助吗?

我不确定我是不是碰巧做对了,但这对我很有帮助。在
UITableViewDataSource
中:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    [...]

    UITableViewCell *standardCell;
    if (UIAccessibilityIsVoiceOverRunning()) {
        standardCell = [tableView dequeueReusableCellWithIdentifier:@"VO Cell"];
    } else {
        standardCell = [tableView dequeueReusableCellWithIdentifier:@"Regular Cell"];
    }

    //Configure the cell
    [...]

    return standardCell;

}
我认为,如果出于性能原因关闭VoiceOver,iOS会缓存没有可访问性属性的单元。因此,您使用的默认标识符可能与不具有这些属性的缓存单元相关。当VoiceOver打开并且iOS尝试将这些单元格出列时,它在其中找不到属性并中断。通过使用不同的标识符,可以在VO打开时强制iOS缓存新单元

再次强调,这只是我正在做的一个假设,但情况是,当我以这种方式将单元格出列时,我不会遇到这个问题。但是,如果您确实按照我提到的方式将其出列,则必须注意可能出现的错误:

如果您是在.xib文件或故事板中设置了标识符的单元出列,如下图所示,则必须使用VO重用标识符设置另一个原型单元。

如果其他人对此问题有问题,我会向苹果公司提交一个关于此问题的bug。我也有同样的问题!我今天开始在我的应用程序中添加辅助功能提示和内容。那真糟糕。你能在这里添加雷达id吗?这样我/我们就可以复制这个bug了。我在5.1 beta 2中仍然有这个bug@ChristianBeer在开放式雷达中发现了你的窃听器并将其复制。(rdar://10763569)谢谢。这真的很糟糕,有人找到解决办法了吗?在iOS 6.0.1中启用画外音时仍然存在同样的问题,非常恼火。