gpt4 book ai didi

objective-c - 加载 xib 时出现 NSUnknownKeyException

转载 作者:行者123 更新时间:2023-11-29 04:19:31 26 4
gpt4 key购买 nike

我在使用 IOS6 的 TOSplitViewController( http://blog.trustedones.com/development/ipad-uisplitviewcontroller-replacement-for-sethidesmasterviewinportrait ) 时遇到问题,因为我的应用程序在加载屏幕后立即崩溃,错误如下:


*** 由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:
'[ setValue:forUndefinedKey:]:此类与键 navRoot 的键值编码不兼容。'`


First throw call stack:
(0x1964012 0x1294e7e 0x19ecfb1 0x28a711 0x20bec8 0x20b9b7 0x236428 0x7d70cc 0x12a8663 0x195f45a 0x7d5bcf 0x69ae37 0x69b418 0x7e934e 0x69b648 0x69b882 0x69bb2a 0x6b2ef5 0x6b2fdb 0x6b3286 0x6b3381 0x6b3eab 0x6b3fc9 0x6b4055 0x7b93ab 0x60a92d 0x12a86b0 0x2dfbfc0 0x2df033c 0x2dfbeaf 0x6a98cd 0x5f21a6 0x5f0cbf 0x5f0bd9 0x5efe34 0x5efc6e 0x5f0a29 0x5f3922 0x69dfec 0x5eabc4 0x5eb311 0x2423 0x5b77b7 0x5b7da7 0x5b8fab 0x5ca315 0x5cb24b 0x5bccf8 0x18bfdf9 0x18bfad0 0x18d9bf5 0x18d9962 0x190abb6 0x1909f44 0x1909e1b 0x5b87da 0x5ba65c 0x20ed 0x2025)
libc++abi.dylib: terminate called throwing an exception

我的应用程序代理

@class RootViewController;
@class DetailViewController;

@interface SplitViewAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
TOSplitViewController *splitViewController;

RootViewController *rootViewController;
DetailViewController *detailViewController;

IBOutlet UINavigationController *navRoot;
IBOutlet UINavigationController *navDetail;
}

@property (nonatomic, retain) UINavigationController *navRoot;
@property (nonatomic, retain) UINavigationController *navDetail;

@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, retain) IBOutlet TOSplitViewController *splitViewController;
@property (nonatomic, retain) IBOutlet RootViewController *rootViewController;
@property (nonatomic, retain) IBOutlet DetailViewController *detailViewController;

@end

navRoot 连接到 RootView,这是一个 UINavigationController

问题是我真的需要让这个工作适用于 IOS4-6,并且到目前为止一切都工作得很完美。有人可以帮忙吗?谢谢

最佳答案

检查包含 RootViewController 的 xib 或 Storyboard 文件。很可能您有某种东西在视觉上连接到名为 navRoot 的 socket ,而该 socket 实际上并不存在于您的代码中。

关于objective-c - 加载 xib 时出现 NSUnknownKeyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13147568/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com