diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m
index 32d7b9676..4bcf7b651 100644
--- a/Classes/ChatRoomTableViewController.m
+++ b/Classes/ChatRoomTableViewController.m
@@ -91,7 +91,11 @@
}
// Scroll to unread
- [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionMiddle animated:animated];
+ if(index >= 0) {
+ [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]
+ atScrollPosition:UITableViewScrollPositionMiddle
+ animated:animated];
+ }
}
#pragma mark - Property Functions
diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m
index 86d8c915c..b231298b1 100644
--- a/Classes/ChatRoomViewController.m
+++ b/Classes/ChatRoomViewController.m
@@ -303,10 +303,14 @@ static UICompositeViewDescription *compositeDescription = nil;
// Scroll
int lastSection = [tableController.tableView numberOfSections] -1;
- int lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
- [tableController.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:lastRow inSection:lastSection]
- atScrollPosition:UITableViewScrollPositionBottom
- animated:TRUE];
+ if(lastSection >= 0) {
+ int lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
+ if(lastRow >=0) {
+ [tableController.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:lastRow inSection:lastSection]
+ atScrollPosition:UITableViewScrollPositionBottom
+ animated:TRUE];
+ }
+ }
[UIView commitAnimations];
}
diff --git a/Classes/ChatRoomViewController.xib b/Classes/ChatRoomViewController.xib
index cbb6a5959..6ed84a132 100644
--- a/Classes/ChatRoomViewController.xib
+++ b/Classes/ChatRoomViewController.xib
@@ -637,7 +637,6 @@
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- TPKeyboardAvoidingTableView
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
@@ -734,14 +733,6 @@
./Classes/ChatRoomViewController.h
-
UIToggleButton
UIButton