1
我曾嘗試2天,現在讓我的故事板顯示與此代碼:獨特的問題在Xcode中顯示第一分鏡場景
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *LoginViewController = [storyboard instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = LoginViewController;
[self.window makeKeyAndVisible];
return YES;
}
不過,我不斷收到這個錯誤,在我的主要一個sigbart:「 NSInvalidArgumentException',原因:'在包NSBundle(已加載)'中找不到名爲'MainStoryboard'的故事板'
Google似乎沒有看到有關這些錯誤的內容嗎?有沒有人有任何想法如何解決它?
更新:當我將其更改爲:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UIViewController *LoginViewController = [storyboard instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = LoginViewController;
[self.window makeKeyAndVisible];
return YES;
}
它給我的錯誤: [3208:C07]如果想要使用主要故事板文件的應用程序代理必須實現窗口屬性。
{的AppDelegate setWindow:]:無法識別的選擇發送到實例0x962bf30
[3208:C07] *終止應用程序由於未捕獲的異常 'NSInvalidArgumentException',原因:「 - [AppDelegate中setWindow:]:無法識別選擇發送到實例0x962bf30'