app with tab bar and navigation bars
Hi all, this is a typical layout of one of apps. Now what I want on clicking of row of one of the view controllers(table view), I want to change the index of o开发者_开发技巧f the tab. Lets say I am in 3rd view, I want to move to the 1st view.
I tried with navigation controller's didShowViewController
delegate method. Seems its not working. Could you please suggest any other way to do this?
Thanks.
Just use the below code in didSelectRowAtIndexPath method of UITableView, then you just need to set the SelectedIndex for Tabbar.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
[self.tabBarController setSelectedIndex:indexPath.row];
}
精彩评论