小编vin*_*inu的帖子

[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]

我正在使用tableview来显示消息,我使用下面的代码

UIView *chatView = [self bubbleView:[NSString stringWithFormat:@"%@", message] from:YES];

[self.chatArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:message, @"text", @"self", @"speaker", chatView, @"view", nil]];
[self.chatTableView reloadData];

[self.chatTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.chatArray count]-1 inSection:0]
                                atScrollPosition: UITableViewScrollPositionBottom
                                animated:YES];
Run Code Online (Sandbox Code Playgroud)

我收到下面给出的错误

[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (0) beyond bounds (0) for section (0).'
Run Code Online (Sandbox Code Playgroud)

PLZ帮助我解决这个问题

xcode objective-c uitableview ios

15
推荐指数
1
解决办法
2万
查看次数

标签 统计

ios ×1

objective-c ×1

uitableview ×1

xcode ×1