如何理解并修复此错误?

时间:2011-04-20 11:48:34

标签: ios crash

2011-04-20 18:38:41.347 RIE[1683:607] -[UICGColor _shouldContinuePlaybackInBackground]: unrecognized selector sent to instance 0x28db10
2011-04-20 18:38:41.417 RIE[1683:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICGColor _shouldContinuePlaybackInBackground]: unrecognized selector sent to instance 0x28db10'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x342ed64f __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x35570c5d objc_exception_throw + 24
    2   CoreFoundation                      0x342f11bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
    3   CoreFoundation                      0x342f0649 ___forwarding___ + 508
    4   CoreFoundation                      0x34267180 _CF_forwarding_prep_0 + 48
    5   MediaPlayer                         0x344628b7 -[MPMoviePlayerViewController _moviePlayerViewController_applicationDidEnterBackgroundNotification:] + 42
    6   Foundation                          0x333b5183 _nsnote_callback + 142
    7   CoreFoundation                      0x342bc20f __CFXNotificationPost_old + 402
    8   CoreFoundation                      0x34256eeb _CFXNotificationPostNotification + 118
    9   Foundation                          0x333b25d3 -[NSNotificationCenter postNotificationName:object:userInfo:] + 70
    10  UIKit                               0x36364d01 -[UIApplication _handleApplicationSuspend:eventInfo:] + 500
    11  UIKit                               0x362feaf9 -[UIApplication handleEvent:withNewEvent:] + 1916
    12  UIKit                               0x362fe215 -[UIApplication sendEvent:] + 44
    13  UIKit                               0x362fdc53 _UIApplicationHandleEvent + 5090
    14  GraphicsServices                    0x33e58e77 PurpleEventCallback + 666
    15  CoreFoundation                      0x342c4a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
    16  CoreFoundation                      0x342c683f __CFRunLoopDoSource1 + 166
    17  CoreFoundation                      0x342c760d __CFRunLoopRun + 520
    18  CoreFoundation                      0x34257ec3 CFRunLoopRunSpecific + 230
    19  CoreFoundation                      0x34257dcb CFRunLoopRunInMode + 58
    20  GraphicsServices                    0x33e5841f GSEventRunModal + 114
    21  GraphicsServices                    0x33e584cb GSEventRun + 62
    22  UIKit                               0x36328d69 -[UIApplication _run] + 404
    23  UIKit                               0x36326807 UIApplicationMain + 670
    24  Motor Show                          0x0000219b main + 70
    25  Motor Show                          0x00002150 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.

1 个答案:

答案 0 :(得分:1)

很难说只给出了堆栈跟踪,但我建议如下:

  1. 在UIApplicationDelegate中实施applicationWillResignActive:,以确保在应用程序进入后台之前暂停或停止视频播放。

  2. 创建一个在您的应用中使用的自定义UIApplication子类,并覆盖_handleApplicationSuspend:eventInfo:方法,使其返回时不会将事件传播到链中的其他类。

  3. 了解如何从通知中心取消注册MPMoviePlayerViewController组件,以便它不会收到“ApplicationDidEnterBackgroundNotification”。