Recently, when dealing with bugly problems, we always see that the reply list has broken down, but we can’t start because there are no specific details
We only know the failure of the conversationlistviewcontroller class. The problem is this and only this information, so we can only start with tableview
#17009 NSInternalInconsistencyException
UITableView (<UITableView: 0x10e1ad400; frame = (0 88; 414 327); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x280df53e0>; layer = <CALayer: 0x2807a1040>; contentOffset: {0, 156.33333333333334}; contentSize: {414, 394}; adjustedContentInset: {0, 0, 0, 0}>) failed to obtain a cell from its dataSource (<CustomChatUIViewController: 0x10e1b0000>)
YuLin + 10902176
Searching online for half a day, uitableview common crashes mainly include the following categories:
The uitableview is not refreshed synchronously after the datasource is updated
UITableView dataSource is not set
Invalid update
failed to obtain a cell from its dataSource
Finally, it is found that in order to avoid array out of bounds, this judgment is added and nil is returned, which will result in failed to obtain a cell from its datasource
if (_conversationList.count<=indexPath.row) {
return nil;
}
//After modification
if (_conversationList.count<=indexPath.row) {//datasource is not synchronized, there will be an out-of-bounds problem, return nil, have failed to obtain a cell from its dataSource problem
static NSString *ident = @"tempcell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ident];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ident];
}
cell.hidden = YES;
return cell;
}
// look at the effect of the later version. The crashing rate of conversationlistviewcontroller is reduced. That’s the problem
Similar Posts:
- How to Use Array.prototype.slice.call(arguments)
- *** glibc detected *** java: free(): invalid next size (fast): 0x00000000024b19d0 ***
- Shell script execution error [: 0: unary operator expected
- [Solved] C Programmer Error: double free or corruption (fasttop)
- [Solved] java.lang.Long cannot be cast to java.lang.Integer
- Springboot Error: Failed to configure a DataSource: ‘url’ attribute is not specified and no embedd
- Each child in an array or iterator should have a unique “key” prop. Check the render method of `Tabl
- 324. Wiggle Sort II
- The split() string in the Vue project is converted into an array and an error is reported. Solution typeerror: cannot read property ‘split’ of null