以编程方式调用情节提要视图控制器时的XcodeAssert

30byixjq  于 2022-12-24  发布在  其他
关注(0)|答案(1)|浏览(116)

我正在以编程方式连接两个故事板视图控制器。我得到以下Assert:

*** Assertion failure in -[FullGalleryViewController loadView], /SourceCache/UIKit_Sim/UIKit-2380.17/UICollectionViewController.m:104

我的代码如下:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
FullScreenViewController *myVC = (FullScreenViewController *)[storyboard instantiateViewControllerWithIdentifier:@"FullScreenViewControllerId"];
[self presentViewController:myVC animated:YES completion:nil];

我已经把故事板的id设置为FullScreenViewControllerId,我不知道我哪里做错了。
如何修复此错误?

2ekbmq32

2ekbmq321#

示例化FullScreenViewController,Assert失败在FullGalleryViewController中。它不是同一个类。

相关问题