Reputation: 1625
I'm developing an application where the user adds new rows to an existing table. When a new row is added, i want to highlight it and make the view focus on the row if the table is scrollable.
Any ideas on how I can do this? I`m still kinda new to iphone and objective-c so any help is highly appreciated ;)
Upvotes: 1
Views: 275
Reputation: 7966
If you know the NSIndexPath of the row you just added, calling selectRowAtIndexPath:animated:scrollPosition: on your table should do the trick:
[self.tableView selectRowAtIndexPath:indexPath
animated:YES
scrollPosition:UITableViewScrollPositionMiddle];
Upvotes: 1