iOS 7中使用[[CCDirector sharedDirector] end]时Cocos2d崩溃

时间:2014-01-14 14:06:03

标签: ios cocos2d-iphone

我准备了一个使用cocos2d的游戏。该应用程序是基于UIView模板。实际问题是,应用程序在从一个视图控制器移动到另一个视图控制器时崩溃。游戏板是使用cocos2d准备的。从包含Cocos2d屏幕的视图控制器移动到另一个视图控制器时,我正在使用 [[CCDirector sharedDirector] end] 结束导演。此代码在iOS6和iOS上运行时没有任何错误。下面。但是当我在iOS7上运行相同的代码时,应用程序崩溃会产生以下错误。

<i>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView context]: unrecognized selector sent to instance 0x17804f40'
*** First throw call stack:
(
    0   CoreFoundation                      0x034205e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02e368b6 objc_exception_throw + 44
    2   CoreFoundation                      0x034bd903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x0341090b ___forwarding___ + 1019
    4   CoreFoundation                      0x034104ee _CF_forwarding_prep_0 + 14
    5   Hood Wordz With Frendz              0x00158ef1 -[CCTextureCache init] + 545
    6   Hood Wordz With Frendz              0x00158b58 +[CCTextureCache sharedTextureCache] + 88
    7   Hood Wordz With Frendz              0x000f6d19 -[CCDirector createStatsLabel] + 57
    8   Hood Wordz With Frendz              0x000f561d -[CCDirector setView:] + 365
    9   Hood Wordz With Frendz              0x000b6d48 -[CCDirectorIOS setView:] + 104
    10  UIKit                               0x01aaf42b -[UIViewController loadView] + 284
    11  UIKit                               0x01aaf73e -[UIViewController loadViewIfRequired] + 78
    12  UIKit                               0x01ad51a5 -[UINavigationController _layoutViewController:] + 39
    13  UIKit                               0x01ad56bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
    14  UIKit                               0x01ad57b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
    15  UIKit                               0x01ad672c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
    16  UIKit                               0x01ad7349 -[UINavigationController __viewWillLayoutSubviews] + 57
    17  UIKit                               0x01c1039d -[UILayoutContainerView layoutSubviews] + 213
    18  UIKit                               0x01a06dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    19  libobjc.A.dylib                     0x02e4881f -[NSObject performSelector:withObject:] + 70
    20  QuartzCore                          0x015c772a -[CALayer layoutSublayers] + 148
    21  QuartzCore                          0x015bb514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    22  QuartzCore                          0x015bb380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    23  QuartzCore                          0x01523156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    24  QuartzCore                          0x015244e1 _ZN2CA11Transaction6commitEv + 393
    25  QuartzCore                          0x01524bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    26  CoreFoundation                      0x033e853e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    27  CoreFoundation                      0x033e848f __CFRunLoopDoObservers + 399
    28  CoreFoundation                      0x033c63b4 __CFRunLoopRun + 1076
    29  CoreFoundation                      0x033c5b33 CFRunLoopRunSpecific + 467
    30  CoreFoundation                      0x033c594b CFRunLoopRunInMode + 123
    31  GraphicsServices                    0x04eca9d7 GSEventRunModal + 192
    32  GraphicsServices                    0x04eca7fe GSEventRun + 104
    33  UIKit                               0x0199c94b UIApplicationMain + 1225
    34  Hood Wordz With Frendz              0x0000313d main + 141
    35  Hood Wordz With Frendz              0x000030a5 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException</i>

你们其中任何人都知道为什么会这样,请帮助我。

0 个答案:

没有答案