objective-c - 设置 View Controller Storyboard ID 不起作用

标签 objective-c xcode

我有这段代码可以转换到另一个 View Controller (我想以编程方式执行此操作,因为该应用程序有许多 View Controller ,所有这些 View Controller 都相互连接):

UIViewController *homeViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"HomeViewController"];
[self presentViewController:homeViewController animated:0 completion:nil];

我还设置了Storyboard ID viewController 的 HomeViewController在 Storyboard文件中。

当我运行它时,我收到错误:'Storyboard (<UIStoryboard: 0x712af50>) doesn't contain a view controller with identifier 'HomeViewController''

为什么我会收到此错误?

最佳答案

我也遇到了同样的问题。我只是清理项目并从模拟器或手机中删除应用程序,然后再次运行它。它起作用了。

关于objective-c - 设置 View Controller Storyboard ID 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15045236/

相关文章:

objective-c - Obj-C/Cocos2d内存问题,调用属性时exc_bad_access

ios - 带有动画的不同图像之间的 UIImageView 转换

swift - Xcode 8.1 Swift 3 错误 : cannot convert value of type 'String' to expected argument type 'UnsafeMutableRawPointer'

objective-c - 如果我释放一个未分配的对象会发生什么?

ios - Xcode UI 测试示例

iphone - Parse 中的 REST API 与 iOS 应用程序交互

ios - iPhone 应用签名 : A valid signing identity matching this profile could not be found in your keychain

objective-c - 如何在 swift 或 objective c 中查找数组类型

iphone - "release"如何在 ARC 上创建一个 UIWebView

objective-c - SBJSON 将 NSString 解析为 NSDictionary