私は iOS アプリを作成しています。ARCもストーリーボードもありません。Navigation Controller内にView Controllerがあります。2番目のビューにプッシュするテーブルビューとナビゲーションボタンがあるはずです。これは私が得るエラーです:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController" nib but the view outlet was not set.'
*** First throw call stack:
(0x1c8d012 0x10cae7e 0x1c8cdeb 0xf2f18 0xf3418 0xf3648 0xf3882 0x42a25 0x42dbf 0x42f55 0x4bf67 0x2a88 0xf7b7 0xfda7 0x10fab 0x22315 0x2324b 0x14cf8 0x1be8df9 0x1be8ad0 0x1c02bf5 0x1c02962 0x1c33bb6 0x1c32f44 0x1c32e1b 0x107da 0x1265c 0x2442 0x2375)
libc++abi.dylib: terminate called throwing an exception
(lldb)
AppDelegate のコード:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewCon = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
self.navCon = [[UINavigationController alloc]initWithRootViewController:self.viewCon];
self.navCon.navigationBar.tintColor= [UIColor greenColor];
self.viewCon.title= @"First View";
self.tblView = [[UITableView alloc] init];
NSMutableArray *viewArr=[[NSMutableArray alloc] init];
[viewArr addObject:self.navCon];
self.navBar = [[UINavigationBar alloc] init];
self.viewCon.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Second View" style:UIBarButtonSystemItemAdd target:self action:(nil)];
[self.window addSubview:self.navBar];
self.window.rootViewController = self.viewCon;
[self.window makeKeyAndVisible];
return YES;
}
この段階では、アプリすら実行できません。問題は何でしょうか?よろしくお願いします