0 ios
我想导航viewController到TargetViewController但我收到以下错误:
2016-05-11 15:47:27.182数字和[2882:209790]***由于未捕获的异常'NSUnknownKeyException'终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不符合键值编码对于关键的bttn.'
***第一次抛出调用堆栈:(0 CoreFoundation 0x00000001016f9f45 __exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000101173deb objc_exception_throw + 48 2 CoreFoundation
0x00000001016f9b89 - [NSException raise] + 9 3 Foundation
0x0000000100d40a6b - [NSObject(NSKeyValueCoding)setValue:forKey:] + 288 4 UIKit 0x0000000101c3104c - [UIViewController setValue:forKey:] + 88 5 UIKit 0x0000000101e5ea71 - [UIRuntimeOutletConnection connect] + 109 6
CoreFoundation 0x000000010163aa80 - [NSArray makeObjectsPerformSelector:] + 224 7 UIKit
0x0000000101e5d454 - [UINib instantiateWithOwner:options:] + 1864 8
UIKit 0x0000000101c37c16 - [UIViewController _loadViewFromNibNamed:bundle:] + 381 9 UIKit 0x0000000101c38542 - [UIViewController loadView] + 178 10 UIKit
0x0000000101c388a0 - [UIViewController loadViewIfRequired] + 138 11 UIKit 0x0000000101c39013 - [UIViewController view] + 27 12 UIKit 0x00000001023db7e7 - [_ UIFullscreenPresentationController _setPresentedViewController:] + 87 13 UIKit 0x0000000101c08dde - [UIPresentationController initWithPresentedViewController:presentingViewController:] + 133 14的UIKit 0x0000000101c4b9ba - [UIViewController中_presentViewController:withAnimationController:完成:] + 4004 15的UIKit 0x0000000101c4ec5c - [UIViewController中_performCoordinatedPresentOrDismiss:动画:] + 489 16的UIKit 0x0000000101c4e76b - [UIViewController中presentViewController:动画:完成: ] + 179 17数字和0x0000000100c756f8 - [ViewController Sum:] + 120 18 UIKit 0x0000000101aa7e91 - [UIApplication sendAction:to:from:forEvent:] + 92 19 UIKit 0x0000000101c134d8 - [UIControl sendAction:to:forEvent:] + 67 20 UIKit 0x0000000101c137a4 - [UIControl _sendActionsForEvents:withEvent:] + 311 21 UIKit 0x0000000101c128d4 - [UIControl touchesEnded:withEvent:] + 601 22 UIKit 0x0000000101b15ed1 - [UIWindow _sendTouchesForEvent:] + 835 23 UIKit 0x0000000101b16c06 - [UIWindow sendEvent:] + 865 24 UIKit
0x0000000101ac62fa - [UIApplication sendEvent:] + 263 25 UIKit
0x0000000101aa0abf _UIApplicationH andleEventQueue + 6844 26的CoreFoundation 0x0000000101626011 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 27的CoreFoundation 0x000000010161bf3c __CFRunLoopDoSources0 + 556 28的CoreFoundation 0x000000010161b3f3 __CFRunLoopRun + 867 29的CoreFoundation
0x000000010161ae08 CFRunLoopRunSpecific + 488 30个GraphicsServices
0x0000000104e95ad2 GSEventRunModal + 161 31的UIKit
0x0000000101aa630d UIApplicationMain + 171 32数之和
0x0000000100c75aaf主+ 111 33 libdyld. dylib
0x0000000103e1d92d start + 1)libc ++ abi.dylib:以NSException类型的未捕获异常终止(lldb)
我的viewController.m
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)Sum:(id)sender {
TargetViewController *add = [[TargetViewController alloc]
initWithNibName:@"TargetViewController123" bundle:nil];
// TargetViewController *membr = [[TargetViewController alloc] initWithNibName:@"TargetViewController123"];
[self presentViewController:add animated:YES completion:nil];
}
@end
Run Code Online (Sandbox Code Playgroud)
我不知道我在哪里得到错误.请帮忙
您的错误在此处描述:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key bttn.
Run Code Online (Sandbox Code Playgroud)
这意味着某些东西试图bttn在没有具有此名称的属性的类上调用属性.如果您IBOutlet在视图控制器中连接了一个,然后在代码中将其删除但忘记从Interface Builder中的元素中删除插座引用,则通常会发生这种情况.
| 归档时间: |
|
| 查看次数: |
70 次 |
| 最近记录: |