views:

15

answers:

1

Im trying to highlight the first row in my table upon first loading the data and just cannot get it to work!

I have tried lots of ways with no joy, the latest attempt being this:

NSUInteger indexArr[] = {0,1};

NSIndexPath *n = [NSIndexPath indexPathWithIndexes:indexArr length:2];

[self.tableView scrollToRowAtIndexPath:n atScrollPosition:UITableViewScrollPositionTop animated:NO];

Help???

+2  A: 

try

[self.tableView selectRowAtIndexPath:n animated:YES scrollPosition:UITableViewScrollPositionTop];

you should probably do this after your view has appeared.

fluchtpunkt
HERO ;-) thanks
user7865437