无法理解崩溃日志

时间:2015-04-25 06:04:24

标签: ios objective-c crash crash-reports

我有一个视图,其中包含一个UIScrollView,在添加所有子视图后,viewDidLoad会在其中添加子视图。在执行所有自定义方法之后,它转到viewWillappear,之后它会崩溃并跟随以下痕迹:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString CIImage]: unrecognized selector sent to instance 0x7db5bb80'
*** First throw call stack:
(
    0   CoreFoundation                      0x04614946 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x0429da97 objc_exception_throw + 44
    2   CoreFoundation                      0x0461c5c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
    3   CoreFoundation                      0x045653e7 ___forwarding___ + 1047
    4   CoreFoundation                      0x04564fae _CF_forwarding_prep_0 + 14
    5   UIKit                               0x02b589f1 -[UIImageView _shouldDrawImage:] + 33
    6   UIKit                               0x02b58aa2 -[UIImageView _canDrawContent] + 164
    7   UIKit                               0x02a2f750 -[UIView(Internal) _shouldInheritScreenScaleAsContentScaleFactor] + 83
    8   UIKit                               0x02a2f7e9 -[UIView(Internal) _applyScreenScaleToContentScaleFactorIfNotSpecifiedByDeveloper] + 35
    9   UIKit                               0x02a2f56e -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1628
    10  UIKit                               0x02b5d762 -[UIImageView _didMoveFromWindow:toWindow:] + 65
    11  UIKit                               0x02a2f23f -[UIView(Internal) _didMoveFromWindow:toWindow:] + 813
    12  UIKit                               0x02a423e1 -[UIScrollView _didMoveFromWindow:toWindow:] + 65
    13  UIKit                               0x02a2f23f -[UIView(Internal) _didMoveFromWindow:toWindow:] + 813
    14  UIKit                               0x02a2f23f -[UIView(Internal) _didMoveFromWindow:toWindow:] + 813
    15  UIKit                               0x02a26517 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 154
    16  UIKit                               0x02a26475 -[UIView(Hierarchy) _postMovedFromSuperview:] + 458
    17  UIKit                               0x02a31f0d -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2018
    18  UIKit                               0x02a2486e -[UIView(Hierarchy) addSubview:] + 56
    19  UIKit                               0x0299d0fa __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 1849
    20  UIKit                               0x02a2b7af +[UIView(Animation) performWithoutAnimation:] + 82
    21  UIKit                               0x0299c5a6 -[_UINavigationParallaxTransition animateTransition:] + 1204
    22  UIKit                               0x02b2b64d -[UINavigationController _startCustomTransition:] + 3765
    23  UIKit                               0x02b38726 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
    24  UIKit                               0x02b39372 -[UINavigationController __viewWillLayoutSubviews] + 57
    25  UIKit                               0x02cad04c -[UILayoutContainerView layoutSubviews] + 213
    26  UIKit                               0x02a34dd1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
    27  libobjc.A.dylib                     0x042b3771 -[NSObject performSelector:withObject:] + 70
    28  QuartzCore                          0x0215928f -[CALayer layoutSublayers] + 152
    29  QuartzCore                          0x0214d115 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397
    30  QuartzCore                          0x0214cf70 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    31  QuartzCore                          0x020ab3c6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
    32  QuartzCore                          0x020ac78c _ZN2CA11Transaction6commitEv + 392
    33  QuartzCore                          0x020ace58 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    34  CoreFoundation                      0x045379de __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    35  CoreFoundation                      0x04537920 __CFRunLoopDoObservers + 400
    36  CoreFoundation                      0x0452d35a __CFRunLoopRun + 1226
    37  CoreFoundation                      0x0452cbcb CFRunLoopRunSpecific + 443
    38  CoreFoundation                      0x0452c9fb CFRunLoopRunInMode + 123
    39  GraphicsServices                    0x05e6b24f GSEventRunModal + 192
    40  GraphicsServices                    0x05e6b08c GSEventRun + 104
    41  UIKit                               0x029a98b6 UIApplicationMain + 1526
    42  POPCorn                             0x000e9472 main + 130
    43  libdyld.dylib                       0x06193ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

2 个答案:

答案 0 :(得分:0)

SDL

您正在访问NSString的CIImage属性(可能是它的id,您刚刚访问此属性,认为id对象是UIImage)。在您的课程中搜索Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString CIImage]: unrecognized selector sent to instance 0x7db5bb80' ,并确保您获得该属性的对象是实际的CIImage

答案 1 :(得分:0)

如果你想找出导致我建议创建异常断点的实际代码行的位置。您可以通过转到断点选项卡并为所有异常添加一个来执行此操作。这与日志一起,您应该看到您将无效参数传递给。