我已阅读过报道。他们中的大多数都提供了很好的解决方案,但它们通常涉及的是一个完全不同于我可以处理的错误。当我跑步时,我得到:
首先抛出调用堆栈:
(
0 CoreFoundation 0x0185f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015e28b6 objc_exception_throw + 44
2 CoreFoundation 0x018fc903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0184f90b ___forwarding___ + 1019
4 CoreFoundation 0x0184f4ee _CF_forwarding_prep_0 + 14
5 SpriteKit 0x010ce32c -[SKNode addChild:] + 403
6 Panda Slide 0x00002c85 -[MHPMyScene initWithSize:] + 597
7 Panda Slide 0x000055bc -[MHPViewController viewWillLayoutSubviews] + 460
8 UIKit 0x0029c21a -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 278
9 libobjc.A.dylib 0x015f481f -[NSObject performSelector:withObject:] + 70
10 QuartzCore 0x03d542ea -[CALayer layoutSublayers] + 148
11 QuartzCore 0x03d480d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
12 QuartzCore 0x03d54235 -[CALayer layoutIfNeeded] + 160
13 UIKit 0x00357613 -[UIViewController window:setupWithInterfaceOrientation:] + 304
14 UIKit 0x00276177 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
15 UIKit 0x00274d16 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
16 UIKit 0x00274be8 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
17 UIKit 0x00274c70 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
18 UIKit 0x00273d0a __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
19 UIKit 0x00273c6c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
20 UIKit 0x002749c3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
21 UIKit 0x00277fb6 -[UIWindow setDelegate:] + 449
22 UIKit 0x00349737 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
23 UIKit 0x0026dc1c -[UIWindow addRootViewControllerViewIfPossible] + 609
24 UIKit 0x0026dd97 -[UIWindow _setHidden:forced:] + 312
25 UIKit 0x0026e02d -[UIWindow _orderFrontWithoutMakingKey] + 49
26 UIKit 0x0027889a -[UIWindow makeKeyAndVisible] + 65
27 UIKit 0x0022bcd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
28 UIKit 0x002303a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
29 UIKit 0x0024487c -[UIApplication handleEvent:withNewEvent:] + 3447
30 UIKit 0x00244de9 -[UIApplication sendEvent:] + 85
31 UIKit 0x00232025 _UIApplicationHandleEvent + 736
32 GraphicsServices 0x038ed2f6 _PurpleEventCallback + 776
33 GraphicsServices 0x038ece01 PurpleEventCallback + 46
34 CoreFoundation 0x017dad65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
35 CoreFoundation 0x017daa9b __CFRunLoopDoSource1 + 523
36 CoreFoundation 0x0180577c __CFRunLoopRun + 2156
37 CoreFoundation 0x01804ac3 CFRunLoopRunSpecific + 467
38 CoreFoundation 0x018048db CFRunLoopRunInMode + 123
39 UIKit 0x0022fadd -[UIApplication _run] + 840
40 UIKit 0x00231d3b UIApplicationMain + 1225
41 Panda Slide 0x00003f7d main + 141
42 libdyld.dylib 0x01f84701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
我认为因为编写rect to screen
而抛出异常。
提前致谢!