I have a chat application, in which i want to increase the index path by one when new chat data come. But it is not happening through my code I am sharing code with screen shot please help.
NSUInteger messageCount = [self numberOfMessages];
if (self.conversation && messageCount > 0) {
NSLog(@"%ld",(long)indexPathValue.row);
NSIndexPath* ip = [NSIndexPath indexPathForRow:indexPathValue.row + 1 inSection:0];
NSLog(@"%ld",(long)ip.row);
[layerChatTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionTop animated:YES];
}