[問題] 多個TabBar
不好意思 新手發問
我想建立一個四個TabBar分頁的控制
AppDelegate.h 的程式碼如下:
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder
<UIApplicationDelegate,UITabBarControllerDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UITabBarController *tab;
@end
AppDelegate.m如下:
#import "AppDelegate.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "thirdViewController.h"
#import "FourthViewController.h"
@implementation AppDelegate
@synthesize window;
@synthesize tab;
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
FirstViewController *v1=[[FirstViewController alloc]
initWithNibName:@"FirstViewController"bundle:nil];
SecondViewController *v2=[[SecondViewController
alloc]initWithNibName:@"SecondViewControler" bundle:nil];
thirdViewController *v3=[[thirdViewController
alloc]initWithNibName:@"thirdViewController" bundle:nil];
FourthViewController *v4=[[FourthViewController
alloc]initWithNibName:@"FourthViewController" bundle:nil];
self.tab = [[UITabBarController alloc]init];
self.tab.viewControllers = [NSArray arrayWithObjects:v1,v2,v3,v4, nil];
self.window.rootViewController = self.tab;
[self.window makeKeyAndVisible];
return YES;
}
最後跑出一個錯誤:Could not load NIB in bundle
請問是哪個環節出錯了 謝謝大家!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.34.32.46
推
10/06 13:29, , 1F
10/06 13:29, 1F
→
10/06 14:06, , 2F
10/06 14:06, 2F
→
10/06 14:08, , 3F
10/06 14:08, 3F
推
10/06 14:28, , 4F
10/06 14:28, 4F
→
10/06 16:04, , 5F
10/06 16:04, 5F
→
10/06 16:04, , 6F
10/06 16:04, 6F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章