how to get IndexPath
<p>in iphone application.</p>

<p>I'm trying to get indexPath.row value to do something  on the basis of  row selected in programmatically created tableview.</p>

<p>Can someone please tell me  why is  the indexPath.row value is not coming correct. It's some thing like  21487...3?</p>

<pre><code>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);
</code></pre>

<p>Thanks,
Aaryan</p>
