2

所以我得到了这个奇怪的 sigabrt 异常,我添加了一个所有异常断点,我得到异常的行是这样的:

[self performSegueWithIdentifier: @"SolveSound" sender: self];

我不明白为什么它会抛出异常,我与下一个视图建立了连接(segue)并将其命名为 SolveSound。

如果需要更多代码,请告诉我。

2013-05-19 23:02:30.785 Game[17957:c07]-[SoundViewController _setViewDelegate:]:无法识别的选择器发送到实例 0x8253a50 2013-05-19 23:02:36.382 Game[17957:c07] * 由于应用程序终止未捕获的异常“NSInvalidArgumentException”,原因:“-[SoundViewController _setViewDelegate:]:无法识别的选择器发送到实例 0x8253a50”*First throw call stack: (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
)
4

0 回答 0