Indexpath.row value not updating
<p>in iphone application.</p>

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

<p>i need to access indexpath.row out of didselectedrowatindexpath method where if/else will define the action on the basis of indexpath.row.</p>

<p>there are 7 cards images in application and one [menu list]table view. whenever user will click on  row of table view,then need to touch the image</p>

<p>I'm trying this code to get the IndexPath.row value. The problem is indexPath.row value is not updating everytime. It's just taking the old value. Please sugggest how to solve this issue.</p>

<pre><code>- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event 
 {

    NSUInteger nSection =[myTableView numberOfSections]-1 ;
    NSUInteger nRow = [myTableView numberOfRowsInSection:nSection];    
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:nRow inSection:nSection]; 

    NSLog(@"No of sections in my table view %d",nSection);    
    NSLog(@"No of rows in my table view %d",nRow);
    NSLog(@"Value of selected indexPath Row %d", [indexPath.row]);
    NSLog(@"VAlue of Array arrOperationChk %d",[arrOperationChk count]);

 }
</code></pre>
