ios - Storyboard不包含带有标识符的 View Controller

标签 ios objective-c xcode storyboard

我不断收到以下错误:

Storyboard (<UIStoryboard: 0x7ebdd20>) doesn't contain a view controller with identifier 'drivingDetails'

这是代码:

- (void)tableView:(UITableView *)tableView 
        didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

   UIViewController *controller =  [self.storyboard instantiateViewControllerWithIdentifier:@"drivingDetails"];
   controller.title = [[dao libraryItemAtIndex:indexPath.row] valueForKey:@"name"];
   [self.navigationController pushViewController:controller animated:YES];
}

我已经在 UIStoryboard 上设置了 identifier,但仍然收到此错误。

enter image description here

<小时/>

最佳答案

仅供将来引用:

我正在使用 Storyboards 在 iOS 6 上进行开发。

我遇到了同样的问题,但我在检查器中找不到“标识符”字段。 相反,只需将名为“ Storyboard ID”的字段设置为您命名的标识符即可。该字段可以在检查器中的“显示身份检查器”选项卡下找到。

[注意 - 下面的评论表明有些人发现他们需要(也?)在检查器中的 Storyboard ID 下方设置“恢复 ID”字段。单击“使用 Storyboard ID”似乎还不够。]

下面有一张图片可供引用:(在本例中,我将标识符命名为与我的类相同的名称) enter image description here

关于ios - Storyboard不包含带有标识符的 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56087868/

相关文章:

ios - 滚动时电子节目指南 View 如何更新?

ios - 浮点值无法转换为 UInt32,因为它大于快速获取的 UInt32.max

ios - 使用 UICollectionView 显示全屏图像

ios - 如何快速更改不同分辨率的一个元素的位置

swift - MyScript Interactive Ink SDK 转换为数学返回?

ios - 应用程序在后台时未立即调用 DidReceiveRemoteNotification

java - 如何在 Java 中检测发起 HTTP 请求的平台

ios - 从图像选择器返回时如何更改 View Controller ?

objective-c - 无法将 Swift 代码导入 Obj-C

ios - 使用 AlamofireObjectMapper 将对象 json 数据映射到 2 个单独的数组中