how to get IndexPath

Posted by user145883 on Stack Overflow See other posts from Stack Overflow or by user145883
Published on 2009-08-14T22:52:16Z Indexed on 2010/05/15 22:02 UTC
Read the original article Hit count: 96

Filed under:

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

© Stack Overflow or respective owner

Related posts about iphone