我試圖在用戶按下鍵盤上的返回後插入一行。 的textFieldShouldReturn方法中的代碼看起來是這樣的:insertRowsAtIndexPaths插入行a
NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:([self.tableView numberOfRowsInSection:([self.tableView numberOfSections] - 1)] - 1)
inSection:([self.tableView numberOfSections] - 1)];
[self.tableView insertRowsAtIndexPaths:@[lastIndexPath]
withRowAnimation:UITableViewRowAnimationRight];
這直到10行被示出,在這之後,行被插入在開始正常工作,然後一個和所述的tableView的結束。 我該如何解決這個問題?
檢查lastIndexPath的值...? – CW0007007
lastIndexPath的值是正確的。 – joelfischerr