[__NSCFType set]:发送到实例的无法识别的选择器

时间:2015-07-19 13:27:30

标签: ios objective-c runtime-error

我的viewController.m中的prepareForSegue方法遇到了问题。

这是我的代码:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if([[segue identifier] isEqualToString: @"moveSegue"])
    {
        SecondViewController *svc = (SecondViewController *)segue.destinationViewController;
        svc.finalPercents = [NSNumber numberWithInt:roundf(percents)];
    }

这是我为“SecondViewController ... segue.destinationViewController;”所带来的错误:

[2015-07-19 04:50:51.345 Click[3831:66529] -[__NSCFType set]: unrecognized selector sent to instance 0x7a06d880
2015-07-19 04:50:51.352 Click[3831:66529] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType set]: unrecognized selector sent to instance 0x7a06d880'
*** First throw call stack:
(
    0   CoreFoundation                      0x00904746 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x0058da97 objc_exception_throw + 44
    2   CoreFoundation                      0x0090c705 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
    3   CoreFoundation                      0x00853287 ___forwarding___ + 1047
    4   CoreFoundation                      0x00852e4e _CF_forwarding_prep_0 + 14
    5   UIFoundation                        0x03fc021f __NSStringDrawingEngine + 30451
    6   UIFoundation                        0x03fb8a0d -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 171
    7   UIKit                               0x010fcc78 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 6649
    8   UIKit                               0x010fa93f -[UILabel drawTextInRect:] + 581
    9   UIKit                               0x010fcd7d -[UILabel drawRect:] + 98
    10  UIKit                               0x00f6a079 -[UIView(CALayerDelegate) drawLayer:inContext:] + 519
    11  QuartzCore                          0x04e9490b -[CALayer drawInContext:] + 118
    12  QuartzCore                          0x04e94841 _ZL16backing_callbackP9CGContextPv + 96
    13  QuartzCore                          0x04d757a2 CABackingStoreUpdate_ + 2788
    14  QuartzCore                          0x04e947d9 ___ZN2CA5Layer8display_Ev_block_invoke + 93
    15  QuartzCore                          0x04ecb0cc x_blame_allocations + 15
    16  QuartzCore                          0x04e94635 _ZN2CA5Layer8display_Ev + 1591
    17  QuartzCore                          0x04e94890 -[CALayer _display] + 33
    18  QuartzCore                          0x04e93ff6 _ZN2CA5Layer7displayEv + 142
    19  QuartzCore                          0x04e9486a -[CALayer display] + 33
    20  QuartzCore                          0x04e88700 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 328
    21  QuartzCore                          0x04e88786 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 38
    22  QuartzCore                          0x04de4c22 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
    23  QuartzCore                          0x04de60b5 _ZN2CA11Transaction6commitEv + 487
    24  QuartzCore                          0x04de67cc _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    25  CoreFoundation                      0x0082586e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    26  CoreFoundation                      0x008257b0 __CFRunLoopDoObservers + 400
    27  CoreFoundation                      0x0081b1ea __CFRunLoopRun + 1226
    28  CoreFoundation                      0x0081aa5b CFRunLoopRunSpecific + 443
    29  CoreFoundation                      0x0081a88b CFRunLoopRunInMode + 123
    30  GraphicsServices                    0x049b42c9 GSEventRunModal + 192
    31  GraphicsServices                    0x049b4106 GSEventRun + 104
    32  UIKit                               0x00ed70b6 UIApplicationMain + 1526
    33  Click                               0x000a92ea main + 138
    34  libdyld.dylib                       0x02e96ac9 start + 1
    35  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

有关如何解决此问题的任何建议?感谢。

0 个答案:

没有答案