Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa touch 将标签链接到IBOutlet会产生NSUnknownKeyException_Cocoa Touch_Ios_Xib_Iboutlet - Fatal编程技术网

Cocoa touch 将标签链接到IBOutlet会产生NSUnknownKeyException

Cocoa touch 将标签链接到IBOutlet会产生NSUnknownKeyException,cocoa-touch,ios,xib,iboutlet,Cocoa Touch,Ios,Xib,Iboutlet,我已经创建了一个选项卡视图。在其中一个选项卡上,我有一个视图,上面有几个标签。它很好用 当我将Interface Builder中的标签连接到文件的所有者(相应的IBoutlet)时,当我打开该选项卡时,应用程序会崩溃,并出现以下错误: 2011-05-15 18:36:29.070 AeroNav[958:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIVie

我已经创建了一个选项卡视图。在其中一个选项卡上,我有一个视图,上面有几个
标签。它很好用

当我将Interface Builder中的标签连接到文件的所有者(相应的IBoutlet)时,当我打开该选项卡时,应用程序会崩溃,并出现以下错误:

2011-05-15 18:36:29.070 AeroNav[958:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x18afe0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key speedLabel.'
*** Call stack at first throw:
(
0   CoreFoundation                      0x312a664f __exceptionPreprocess + 114
1   libobjc.A.dylib                     0x34a07c5d objc_exception_throw + 24
2   CoreFoundation                      0x312a63cd -[NSException dealloc] + 0
3   Foundation                          0x351c7edb -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 182
4   Foundation                          0x351809cb _NSSetUsingKeyValueSetter + 90
5   Foundation                          0x35180217 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 194
6   Foundation                          0x3516242f -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 130
7   UIKit                               0x369848df -[UIRuntimeOutletConnection connect] + 66
8   CoreFoundation                      0x3123ed7b -[NSObject(NSObject) performSelector:] + 18
9   CoreFoundation                      0x3123e99d -[NSArray makeObjectsPerformSelector:] + 388
10  UIKit                               0x36983847 -[UINib instantiateWithOwner:options:] + 586
11  UIKit                               0x36984e09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
12  UIKit                               0x368fe5e9 -[UIViewController _loadViewFromNibNamed:bundle:] + 36
13  UIKit                               0x368cbfa5 -[UIViewController loadView] + 80
14  UIKit                               0x367b0ebf -[UIViewController view] + 30
15  UIKit                               0x367ee1db -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 66
16  UIKit                               0x367ee18d -[UITabBarController transitionFromViewController:toViewController:] + 32
17  UIKit                               0x367eda33 -[UITabBarController _setSelectedViewController:] + 186
18  UIKit                               0x36872ceb -[UITabBarController setSelectedViewController:] + 14
19  UIKit                               0x36872be7 -[UITabBarController _tabBarItemClicked:] + 226
20  CoreFoundation                      0x31216571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
21  UIKit                               0x36796ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
22  UIKit                               0x36796e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
23  UIKit                               0x36872a8b -[UITabBar _sendAction:withEvent:] + 270
24  CoreFoundation                      0x31216571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
25  UIKit                               0x36796ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
26  UIKit                               0x36796e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
27  UIKit                               0x36796e3b -[UIControl sendAction:to:forEvent:] + 38
28  UIKit                               0x36796b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
29  UIKit                               0x367d0bd9 -[UIControl sendActionsForControlEvents:] + 16
30  UIKit                               0x36872815 -[UITabBar(Static) _buttonUp:] + 80
31  CoreFoundation                      0x31216571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
32  UIKit                               0x36796ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
33  UIKit                               0x36796e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
34  UIKit                               0x36796e3b -[UIControl sendAction:to:forEvent:] + 38
35  UIKit                               0x36796b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
36  UIKit                               0x36797423 -[UIControl touchesEnded:withEvent:] + 342
37  UIKit                               0x36795bf5 -[UIWindow _sendTouchesForEvent:] + 368
38  UIKit                               0x3679556f -[UIWindow sendEvent:] + 262
39  UIKit                               0x3677e313 -[UIApplication sendEvent:] + 298
40  UIKit                               0x3677dc53 _UIApplicationHandleEvent + 5090
41  GraphicsServices                    0x36452e77 PurpleEventCallback + 666
42  CoreFoundation                      0x3127da97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
43  CoreFoundation                      0x3127f83f __CFRunLoopDoSource1 + 166
44  CoreFoundation                      0x3128060d __CFRunLoopRun + 520
45  CoreFoundation                      0x31210ec3 CFRunLoopRunSpecific + 230
46  CoreFoundation                      0x31210dcb CFRunLoopRunInMode + 58
47  GraphicsServices                    0x3645241f GSEventRunModal + 114
48  GraphicsServices                    0x364524cb GSEventRun + 62
49  UIKit                               0x367a8d69 -[UIApplication _run] + 404
50  UIKit                               0x367a6807 UIApplicationMain + 670
51  AeroNav                             0x00002423 main + 70
52  AeroNav                             0x000023d8 start + 40
)
terminate called after throwing an instance of 'NSException'
2011-05-15 18:36:29.070 AeroNav[958:707]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不符合key speedLabel的键值编码。”
***第一次抛出时调用堆栈:
(
0 CoreFoundation 0x312a664f例外预处理+114
1 libobjc.A.dylib 0x34a07c5d objc_异常_抛出+24
2 CoreFoundation 0x312a63cd-[N异常解除锁定]+0
3基金会0x351C7EDB-[ NSKORKS(NSKEY ValueCoDIN)SETValue:FununDealdKe::+ 182
4基金会0x351809CB,NSSESEUSEKIKEVSETETER + 90
5基金会0x35180217-[NSbObjs](NSKEY ValueCudid)SETValu:
6基金会0x3516242F-[NSObjuts:NSKEY ValueCoDIN)设置值:FrKePosie:] + 130
7 UIKit 0x369848df-[UIRuntimeOutletConnection connect]+66
8 CoreFoundation 0x3123ed7b-[NSObject(NSObject)性能选择器:][18
9 CoreFoundation 0x3123e99d-[NSArray makeObjectsPerformSelector:+388
10 UIKit 0x36983847-[UINib实例化所有者:选项:][586
11 UIKit 0x36984e09-[NSBundle(UINSBUNDLEADTIONS)LOADNIBNAME:所有者:选项:][92
12 UIKit 0x368fe5e9-[UIViewController\u loadViewFromNibNamed:bundle:][36
13 UIKit 0x368cbfa5-[UIViewController loadView]+80
14 UIKit 0x367b0ebf-[UIVIEW控制器视图]+30
15 UIKit 0x367ee1db-[UITabBarController转换从ViewController:到ViewController:转换:应选择设置:][66
16 UIKit 0x367ee18d-[UITabBarController从VIEWCONTROLLER:转换到VIEWCONTROLLER::+32
17 UIKit 0x367eda33-[UITabBarController _SETSELECTEDVIEW CONTROLLER:+186
18 UIKit 0x36872ceb-[UITabBarController SETSELECTED VIEW CONTROLLER:+14
19 UIKit 0x36872be7-[UITabBarController_tabBarItemClicked:+226
20 CoreFoundation 0x31216571-[NSObject(NSObject)性能选择器:withObject:withObject:+24
21 UIKit 0x36796ec9-[UIApplication sendAction:to:from:forEvent:][84
22 UIKit 0x36796e69-[UIApplication sendAction:toTarget:fromSender:forEvent:][32
23 UIKit 0x36872a8b-[UITabBar\u sendAction:withEvent:+270
24 CoreFoundation 0x31216571-[NSObject(NSObject)性能选择器:withObject:withObject:+24
25 UIKit 0x36796ec9-[UIApplication sendAction:to:from:forEvent:+84
26 UIKit 0x36796e69-[UIApplication sendAction:toTarget:fromSender:forEvent:+32
27 UIKit 0x36796e3b-[UIControl发送操作:到:forEvent:+38
28 UIKit 0x36796b8d-[UIControl(内部)\发送操作预防:带事件:][356
29 UIKit 0x367d0bd9-[UIControl发送操作控件事件:][16
30 UIKit 0x36872815-[UITabBar(静态)\u按钮:+80
31 CoreFoundation 0x31216571-[NSObject(NSObject)性能选择器:withObject:withObject:+24
32 UIKit 0x36796ec9-[UIApplication sendAction:to:from:forEvent:+84
33 UIKit 0x36796e69-[UIApplication sendAction:toTarget:fromSender:forEvent:][32
34 UIKit 0x36796e3b-[UIControl发送操作:到:forEvent:+38
35 UIKit 0x36796b8d-[UIControl(内部)\发送操作预防:带事件:+356
36 UIKit 0x36797423-[UIControl触摸已结束:带事件:][342
37 UIKit 0x36795bf5-[UIWindow\u sendTouchesForEvent:+368
38 UIKit 0x3679556f-[UIWindow sendEvent:+262
39 UIKit 0x3677e313-[UIApplication sendEvent:+298
40 UIKit 0x3677dc53 _UIApplicationHandleEvent+5090
41图形服务0x36452e77紫罗兰返回+666
42 CoreFoundation 0x3127da97\uuuu CFRUNLOOP\u正在调用\u OUT\u以执行\u函数\uuu+26
43 CoreFoundation 0x3127f83f\uuu CFRunLoopDoSource1+166
44 CoreFoundation 0x3128060d_u CFRunLoopRun+520
45 CoreFoundation 0x31210ec3 CFRunLoopRunSpecific+230
46 CoreFoundation 0x31210dcb CFRUNLOOPSRUNINMODE+58
47图形服务0x3645241f GSEventRunModal+114
48图形服务0x364524cb GSEventRun+62
49 UIKit 0x367a8d69-[UIU应用程序运行]+404
50 UIKit 0x367a6807 UIApplicationMain+670
51航空导航0x00002423主设备+70
52 AeroNav 0x000023d8启动+40
)
在抛出“NSException”实例后调用terminate
我已经了解到,这可能与xib与其视图控制器不匹配(正确连接)有关。我不知道如何检查或修复它

这是我的头文件的外观:

//Stats.h
#import <UIKit/UIKit.h>
@interface Stats : UIViewController
{
    IBOutlet UILabel *speedLabel;
    IBOutlet UILabel *headingLabel;
}
@end
//Stats.h
#进口
@接口统计信息:UIViewController
{
IBUILabel*速度