Ios 获取信号sigabrt异常,找不到错误
所以我得到了这个奇怪的sigabrt异常,我添加了一个all exception断点,我得到异常的行是:Ios 获取信号sigabrt异常,找不到错误,ios,objective-c,xcode,sigabrt,Ios,Objective C,Xcode,Sigabrt,所以我得到了这个奇怪的sigabrt异常,我添加了一个all exception断点,我得到异常的行是: [self performSegueWithIdentifier: @"SolveSound" sender: self]; 我不明白它为什么会抛出异常,我建立了到下一个视图的连接(segue),并将其命名为SolveSound 如果还需要代码,请告诉我 2013-05-19 23:02:30.785游戏[17957:c07]-[SoundViewController _setViewDe
[self performSegueWithIdentifier: @"SolveSound" sender: self];
我不明白它为什么会抛出异常,我建立了到下一个视图的连接(segue),并将其命名为SolveSound
如果还需要代码,请告诉我
2013-05-19 23:02:30.785游戏[17957:c07]-[SoundViewController
_setViewDelegate::无法识别的选择器发送到实例0x8253a50 2013-05-19 23:02:36.382游戏[17957:c07]*由于以下原因终止应用程序
未捕获异常“NSInvalidArgumentException”,原因:
'-[SoundViewController\u setViewDelegate:]:已发送无法识别的选择器
到实例0x8253a50'
*第一次抛出调用堆栈:(0x15c4012 0x13e9e7e 0x164f4bd 0x15b3bbc 0x15b394e 0x412f7c 0x40f440 0xe175be 0xe170e7 0xe41b58 0x54b019
0x13fd663 0x15bf45a 0x549b1c 0x40e7e7 0x40edc8 0x40eff8 0x40f232
0x40f4da 0x4268e5 0x4269cb 0x426c76 0x426d71 0x42789b 0x427e93
0xe9d83f7 0x427a88 0x783e63 0x775b99 0x40fdd2 0xe9d012c 0x4b53
0x3dd285 0x3dd4ed 0xde75b3 0x1583376 0x1582e06 0x156aa82 0x1569f44
0x1569e1b 0x24107e3 0x2410668 0x32dffc 0x262d 0x2555)libc++abi.dylib:
终止引发异常的调用(lldb)
顺便说一下,这是我在输出中得到的
编辑:添加了SoundViewController代码:
@interface SoundViewController ()
@end
@implementation SoundViewController
{
SoundItem *currentSound;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.answerTextField becomeFirstResponder];
}
- (BOOL)textField:(UITextField *)theTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString *newText = [theTextField.text stringByReplacingCharactersInRange:range withString:string];
if ([newText length] > 0) {
self.checkButton.enabled = YES;
} else {
self.checkButton.enabled = NO;
}
return YES;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
编辑:添加堆栈跟踪
2013-05-19 23:42:33.900 Game[18590:c07] Stack trace: (
0 CoreFoundation 0x015c402e __exceptionPreprocess + 206
1 libobjc.A.dylib 0x013e9e7e objc_exception_throw + 44
2 CoreFoundation 0x0164f4bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 253
3 CoreFoundation 0x015b3bbc ___forwarding___ + 588
4 CoreFoundation 0x015b394e _CF_forwarding_prep_0 + 14
5 UIKit 0x00412f7c +[UIViewController setViewController:forView:] + 40
6 UIKit 0x0040f440 -[UIViewController setView:] + 521
7 Foundation 0x00e175be _NSSetUsingKeyValueSetter + 82
8 Foundation 0x00e170e7 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
9 Foundation 0x00e41b58 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
10 UIKit 0x0054b019 -[UIRuntimeOutletConnection connect] + 106
11 libobjc.A.dylib 0x013fd663 -[NSObject performSelector:] + 62
12 CoreFoundation 0x015bf45a -[NSArray makeObjectsPerformSelector:] + 314
13 UIKit 0x00549b1c -[UINib instantiateWithOwner:options:] + 1327
14 UIKit 0x0040e7e7 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
15 UIKit 0x0040edc8 -[UIViewController loadView] + 302
16 UIKit 0x0040eff8 -[UIViewController loadViewIfRequired] + 73
17 UIKit 0x0040f232 -[UIViewController view] + 33
18 UIKit 0x0040f4da -[UIViewController contentScrollView] + 36
19 UIKit 0x004268e5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36
20 UIKit 0x004269cb -[UINavigationController _layoutViewController:] + 43
21 UIKit 0x00426c76 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 254
22 UIKit 0x00426d71 -[UINavigationController _startTransition:fromViewController:toViewController:] + 72
23 UIKit 0x0042789b -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
24 UIKit 0x00427e93 -[UINavigationController pushViewController:transition:forceImmediate:] + 1030
25 UIKit 0x0ab343f7 -[UINavigationControllerAccessibility(SafeCategory) pushViewController:transition:forceImmediate:] + 71
26 UIKit 0x00427a88 -[UINavigationController pushViewController:animated:] + 62
27 UIKit 0x00783e63 -[UIStoryboardPushSegue perform] + 1111
28 UIKit 0x00775b99 -[UIStoryboardSegueTemplate _perform:] + 174
29 UIKit 0x0040fdd2 -[UIViewController performSegueWithIdentifier:sender:] + 72
30 UIKit 0x0ab2c12c -[UIViewControllerAccessibility(SafeCategory) performSegueWithIdentifier:sender:] + 63
31 Game 0x00004e63 -[PickSoundViewController tableView:didSelectRowAtIndexPath:] + 339
32 UIKit 0x003dd285 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1194
33 UIKit 0x003dd4ed -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 201
34 Foundation 0x00de75b3 __NSFireDelayedPerform + 380
35 CoreFoundation 0x01583376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
36 CoreFoundation 0x01582e06 __CFRunLoopDoTimer + 534
37 CoreFoundation 0x0156aa82 __CFRunLoopRun + 1810
38 CoreFoundation 0x01569f44 CFRunLoopRunSpecific + 276
39 CoreFoundation 0x01569e1b CFRunLoopRunInMode + 123
40 GraphicsServices 0x024107e3 GSEventRunModal + 88
41 GraphicsServices 0x02410668 GSEventRun + 104
42 UIKit 0x0032dffc UIApplicationMain + 1211
43 Game 0x00002824 main + 164
44 Game 0x00002735 start + 53
)
您是否正在某个地方设置SoundViewController中的viewDelegate属性?如果你是,试着评论一下line@ila我没有在任何地方设置它,我添加了SoundViewController的代码。另外,添加一个异常断点,并查看如何获得正确的异常跟踪。请参阅视图控制器,文件所有者应设置为SoundViewController。进入故事板或单击声音视图控制器。现在单击文件所有者,将自定义类设置为SoundViewController。现在单击控制器的最上面的视图,确保该视图的自定义类为UIVIEW您是否也将文件所有者设置为SoundViewController?