How to get cell text based on indexPath?

Posted by Sheehan Alam on Stack Overflow See other posts from Stack Overflow or by Sheehan Alam
Published on 2010-05-24T07:21:35Z Indexed on 2010/05/24 7:31 UTC
Read the original article Hit count: 217

I have a UITabBarController with more than 5 UITabBarItems so the moreNavigationController is available.

In my UITabBarController Delegate I do the following:

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
//do some stuff
//...

UITableView *moreView = (UITableView *)self.tabBarController.moreNavigationController.topViewController.view;
    moreView.delegate = self;
}

I want to implement a UITableViewDelegate so I can capture the row that was selected, set a custom view property and then push the view controller:

- (void)tableView:(UITableView *)tblView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
  //how can I get the text of the cell here?
}

I need to get the text of a cell when the user taps on a row. How can I accomplish this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c