2012-09-18 14 views
2

我有一個基於選項卡的應用程序,其中某些部分適用於所有人,但用戶應該註冊才能訪問,因此,我想將其更改爲UIView以便登錄。將UIView更改爲MainStoryboard中的另一個

登錄觀點在第一個選項卡分配,在MainStoryboard

enter image description here

現在,我在另一個選項卡,另一部分(已具有的.xib文件),我想展現「登錄「查看:

Login *aLogin = [[Login alloc] initWithNibName:@"LOGIN" bundle:nil]; 
[self presentModalViewController:aLogin animated:YES]; 

但它崩潰,因爲登錄xib不存在。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 

如何加載「登錄」uiview?

謝謝!

回答

1

我找到了!

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; 
Login *aLogin = [storyboard instantiateViewControllerWithIdentifier:@"Login"]; 
[self presentModalViewController:aLogin animated:YES]; 
+0

將您的問題標記爲已回答! @ user1256477 – Salmo

+0

我不能!當我寫回答時,我必須等待2天! – user1256477

相關問題