
任何人都能指出我正确的方向来结合一个来解决这个问题吗?
请记住以下事实:
>我正在为iOS5开发
>我正在使用Xcode 4.2
在[appname] -Info.pList中删除对主xib的引用
在main.m中,加载您的委托:
int retVal = UIApplicationMain(argc,argv,nil,@"myAppDelegate");
在app delegate中,加载tabbar,导航控制器和navigationController中的视图.
- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // create window since nib is not. CGRect windowBounds = [[UIScreen mainScreen] applicationFrame]; windowBounds.origin.y = 0.0; [self setwindow:[[UIWindow alloc] initWithFrame:windowBounds]]; // VIEw Controllers for tabController (one vIEwController per tab) NSMutableArray *vIEwControllers = [[NSMutableArray alloc] init]; // first tab has vIEw controller in navigation controller FirstVIEw *firstVIEw = [[FirstVIEw alloc] initWithNibname:@"FirstVIEw" bundle:nil]; UINavigationController *navController = [[UINavigationController alloc] initWithRootVIEwController:firstVIEw]; [vIEwControllers addobject:navController]; SecondVIEw *secondVIEw = [[SecondVIEw alloc] initWithNibname:@"SecondVIEw" bundle:nil]; [vIEwControllers addobject:secondVIEw]; // create the tab controller and add the vIEw controllers UITabbarController *tabController = [[UITabbarController alloc] init]; [tabController setVIEwControllers:vIEwControllers]; // add tabbar and show [[self window] addSubvIEw:[tabController vIEw]]; [self.window makeKeyAndVisible]; return YES;} 总结 以上是内存溢出为你收集整理的iphone – 将UITabBarController与UINavigationController结合使用全部内容,希望文章能够帮你解决iphone – 将UITabBarController与UINavigationController结合使用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)