how to get IndexPath
- by user145883
in iphone application.
I'm trying to get indexPath.row value to do something on the basis of row selected in programmatically created tableview.
Can someone please tell me why is the indexPath.row value is not coming correct. It's some thing like 21487...3?
NSUInteger nSections = [myTableView numberOfSections];
NSUInteger nRows = [myTableView numberOfRowsInSection:nSections];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow: nRows inSection:nSections];
NSLog(@"No of sections in my table view %d",nSections);
NSLog(@"No of rows in my table view %d",nRows);
NSLog(@"Value of selected indexPath Row %d", indexPath.row);
Thanks,
Aaryan