ios - EXC_BAD_ACCESS 仅当从 UITableView 中一直向下滚动返回时

标签 ios xcode uitableview ios7

EXC_BAD_ACCESS(代码=1,地址=0x71474b80)

当用户从嵌套的 UITableView 中一直向下滚动返回时,会出现此错误。如果我不滚动到底部,则不会发生错误。

可能存在建议的重新分配问题

UIViewTableController: "EXC_BAD_ACCESS" When Scrolling Up/Down Past the Max Position of the Table

我的代码是:

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

    static NSString *CellIdentifier = @"TroncalesInfo";

    TroncalesViewCell *cell = [[TroncalesViewCell alloc]init];
    cell = [tabla dequeueReusableCellWithIdentifier:CellIdentifier];
    cell.IDTroncal = [nombresTroncales objectAtIndex:indexPath.row];

    [cell setCellAtributes:indexPath db:dataBase];

    return cell;
}

最佳答案

这是我经常使用的小技巧。我不知道它为什么有效,但请尝试一下 ;)。

将此插入到您的 viewController 的 viewWillDisappear 中:

tabla.delegate = nil;

关于ios - EXC_BAD_ACCESS 仅当从 UITableView 中一直向下滚动返回时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20589028/

相关文章:

ios - 动画 GIF 在 iPhone 上不起作用

ios - Build Active Architecture Only -> No 和使用 lipo 创建胖二进制文件有什么区别?

Xcode:如何向上翻页和向下翻页以移动光标?

ios - 未缓存模块时,iOS 框架中的 C 静态库“无法构建 Objective-C 模块”

ios - Swift 类 Data 和 UITableViewController 运行时错误

ios - 应用程序性能问题

ios - 与 Objective-C 中的属性相比,公共(public)实例变量访问速度快多少

ios - 由于在应用程序的其他位置使用了UIMenuController,因此UISearchBar显示错误的UIMenuItems

ios - 根据动态本地内容确定 UIWebView 高度,在可变高度 TableViewCell 内

ios - UITableview、SDWebImage、cell复用和UIImage问题