What is the meaning of the “no index path for table cell being reused” message in iOS 6/7?

前端 未结 14 2310
一整个雨季
一整个雨季 2020-11-27 15:12

Since starting to compile my app with iOS 6 (and since also iOS 7) I\'ve started seeing this message. I know that the way that UITableViews go about managing cells is diffe

14条回答
  •  盖世英雄少女心
    2020-11-27 16:00

    For the record, I encountered this message too when running under iOS 6. It appears that some code either inherited or imported had something like this:

    (NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section {
        NSInteger rows = 0;
        if ([delegate respondsToSelector:@selector(numberOfItemsInSection:)]) {
            rows = [delegate numberOfItemsInSection:section];
    
            [tableView beginUpdates];
            [tableView endUpdates];
        }
    }
    

    When the beginUpdate: / endUpdate: sequence was removed, the problem magically disappeared.

提交回复
热议问题