Skip to content

Commit

Permalink
Merge pull request #12 from MoathOthman/master
Browse files Browse the repository at this point in the history
crash issue
  • Loading branch information
arturdev committed Jun 23, 2014
2 parents c4f229e + f580f1d commit 6dd73b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions SOMessaging/SOMessageInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ - (void)adjustTableViewWithCurve:(BOOL)withCurve scrollsToBottom:(BOOL)scrollToB
UIEdgeInsets contentInsets = UIEdgeInsetsMake(self.tableView.contentInset.top, 0.0, keyboardFrame.size.height + self.frame.size.height, 0.0);

NSInteger section = [self.tableView numberOfSections] - 1;
if (section==-1) {
return;
}
NSInteger row = [self.tableView numberOfRowsInSection:section] - 1;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];

Expand Down
4 changes: 3 additions & 1 deletion SOMessaging/SOMessagingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ - (void)viewDidLayoutSubviews
NSInteger section = self.conversation.count - 1;
NSInteger row = [self.conversation[section] count] - 1;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
if ( indexPath.row !=-1) {
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
}
}
});
}
Expand Down

0 comments on commit 6dd73b3

Please sign in to comment.