我有关联到一个UIViewController定制类XIB文件(ZocaloPlayerViewController)现在视图控制器模态,从厦门国际银行文件
和IM试图提出一个UIViewController(在故事板制作)模态与水平翻转
,但我得到一个错误:
这是我尝试如何呈现视图控制器
ShowDetailsArtistAlbumViewController *vc = [[ShowDetailsArtistAlbumViewController alloc] initWithNibName:@"ShowDetailsArtistAlbumViewController" bundle:nil];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:^{
}];
但我得到这个错误...
Uncaught exception: Could not load NIB in bundle: 'NSBundle </var/mobile/Containers/Bundle/Application/57C2AD20-51DB-4C43-BB8F-2E8F22CD2E2A/MyMusicApp.app> (loaded)' with name 'ShowDetailsArtistAlbumViewController'
我与
[self.parentViewController presentViewController:vc animated:YES completion:^{
}];
努力,但没有任何反应..
编辑: 我试过这种方式
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
ShowDetailsArtistAlbumViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ShowDetailsArtistAlbumViewController"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:^{
}];
视图控制器呈现,但即时得到内部
我正在解释自己错了。我想要呈现的视图控制器是在故事板中制作的。看看我的问题编辑。 – Quetool
你不听我说的话。视图控制器如何实例化并不重要。该错误消息意味着运行时正在寻找称为_ShowDetailsArtistAlbumViewController.xib_的xib文件,但您没有。 – matt
马特,我明白了,但如果视图控制器是在故事板,我必须把笔尖名称?请看我编辑图像的问题... – Quetool