Madoc
Madoc

Reputation: 1625

Iphone: Highlight row when added

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

Answers (1)

Adrian Kosmaczewski
Adrian Kosmaczewski

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

Related Questions