Which number is the first object in a NSArray? I originally thought it was 0 but I may be wrong.
Also which number is the first cell in a UITableView? I thought the first indexpath.row was 1 but I also may be wrong?
Are there any links anyone can point me to, where Apple explains this?
Thanks!
-(BOOL) textFieldShouldReturn:(UITextField *)thetextField {
CustomCell *cell = (CustomCell*)[thetextField superview];
NSIndexPath *indexPath = [thetableView indexPathForCell:cell];
NSLog(@"%i", indexPath.row);
Index 0 represents the first element in NSArray.
As for UITableView, you have both a row and section number in an index path. So the first element of the first section is when
indexPath.row = 0andindexPath.section = 0.