You can use the selectRowAtIndexPath
delegate:
[tblMyTable selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
Of course, replace [NSIndexPath indexPathForRow:0 inSection:0]
with the section / row that you want to automatically set.
You can either put this in your viewDidLoad
or viewWillAppear:
delegate.
Also, make sure that you define your tblMyTable
(or whatever you have named your table) in your header, hooked it up through Interface Builder (if your using a custom XIB), and use @synthesize
in your .m
And the didSelectRowAtIndex:
should be called when you use that method, so as long as your detailItem code is in didSelectRowAtIndex
, you should be good.