iphone sdk:从第一个选项卡栏项开始单击按钮时,将焦点设置为不同的选项卡栏视图

iphone sdk:从第一个选项卡栏项开始单击按钮时,将焦点设置为不同的选项卡栏视图,iphone,cocoa-touch,Iphone,Cocoa Touch,如何从第一个选项卡栏项开始单击按钮,将焦点设置为不同的选项卡栏视图?感谢您找到了解决方案: HelloWorldAppDelegate *theDelegate = (HelloWorldAppDelegate*)[[UIApplication sharedApplication] delegate]; tabController = theDelegate.tabBarController; tabController.selectedIndex = 1; 找到解决方案: HelloWorl

如何从第一个选项卡栏项开始单击按钮,将焦点设置为不同的选项卡栏视图?感谢您找到了解决方案:

HelloWorldAppDelegate *theDelegate = (HelloWorldAppDelegate*)[[UIApplication sharedApplication] delegate];
tabController = theDelegate.tabBarController;
tabController.selectedIndex = 1;
找到解决方案:

HelloWorldAppDelegate *theDelegate = (HelloWorldAppDelegate*)[[UIApplication sharedApplication] delegate];
tabController = theDelegate.tabBarController;
tabController.selectedIndex = 1;
你没击中球

L1AppAppDelegate*数据门=(L1AppAppDelegate*)[[UIApplication sharedApplication]委托]; tabBarController=theDelegate.tabBarController; tabBarController.selectedIndex=1

U没有击中指针

L1AppAppDelegate*数据门=(L1AppAppDelegate*)[[UIApplication sharedApplication]委托]; tabBarController=theDelegate.tabBarController; tabBarController.selectedIndex=1

试试这个

self.tabBarController.selectedViewController = YOURTABBARITEMController;
self.tabBarController.selectedViewController 
    = [self.tabBarController.viewControllers objectAtIndex:1];
不要忘记在接口(.h)中声明
yourtabarcontroller
,合成它,然后将接口文件导入.m文件

另外,对于我来说,I
MYTABBARController
也在接口中声明为
@class

你可以让它为你工作。。。。看起来像个国王

试试这个

self.tabBarController.selectedViewController = YOURTABBARITEMController;
self.tabBarController.selectedViewController 
    = [self.tabBarController.viewControllers objectAtIndex:1];
不要忘记在接口(.h)中声明
yourtabarcontroller
,合成它,然后将接口文件导入.m文件

另外,对于我来说,I
MYTABBARController
也在接口中声明为
@class

你可以让它为你工作。。。。看起来像个国王