Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 带有选项卡栏和导航栏的应用程序_Iphone_Tabs_Navigation - Fatal编程技术网

Iphone 带有选项卡栏和导航栏的应用程序

Iphone 带有选项卡栏和导航栏的应用程序,iphone,tabs,navigation,Iphone,Tabs,Navigation,大家好, 这是其中一个应用程序的典型布局。现在,单击其中一个视图控制器(表视图)的行,我想要更改选项卡的索引。假设我在第三视图中,我想移动到第一视图 我尝试了导航控制器的didShowViewControllerdelegate方法。看来它不起作用了。你能建议其他方法吗 谢谢。只需在UITableView的DidSelectRowatineIndexPath方法中使用以下代码,然后您只需为Tabbar设置SelectedIndex - (void)tableView:(UITableView *

大家好, 这是其中一个应用程序的典型布局。现在,单击其中一个视图控制器(表视图)的行,我想要更改选项卡的索引。假设我在第三视图中,我想移动到第一视图

我尝试了导航控制器的
didShowViewController
delegate方法。看来它不起作用了。你能建议其他方法吗


谢谢。

只需在UITableView的DidSelectRowatineIndexPath方法中使用以下代码,然后您只需为Tabbar设置SelectedIndex

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    // Navigation logic may go here. Create and push another view controller.
    [self.tabBarController setSelectedIndex:indexPath.row];

}