Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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 如何在选项卡栏中编程selecteditem_Iphone_Objective C_Uitabbar - Fatal编程技术网

Iphone 如何在选项卡栏中编程selecteditem

Iphone 如何在选项卡栏中编程selecteditem,iphone,objective-c,uitabbar,Iphone,Objective C,Uitabbar,我有这个选项卡栏我想在这个选项卡栏中配置每个选项卡项例如当我选择第一个项目时我想进入这个视图(我的电子空间)例如第一个项目 我已经做了这个代码,但它没有工作 - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{ if(self.tabBar.selectedItem==[self.tabBar.items objectAtIndex:0]) { CondidatsViewC

我有这个选项卡栏我想在这个选项卡栏中配置每个选项卡项例如当我选择第一个项目时我想进入这个视图(我的电子空间)例如第一个项目

我已经做了这个代码,但它没有工作

  - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{

    if(self.tabBar.selectedItem==[self.tabBar.items objectAtIndex:0])
    {
        CondidatsViewController *condidatsViewController=[[CondidatsViewController alloc]initWithNibName:@"condidatsViewController"bundle:nil];
        [self.navigationController pushViewController:condidatsViewController animated:YES];

    }

}

你在用故事板吗?不,我不用故事板