gpt4 book ai didi

ios - 与 avplayeritem 的 doesNotRecognizeSelector 一起崩溃

转载 作者:行者123 更新时间:2023-12-02 01:38:19 24 4
gpt4 key购买 nike

我在看起来像是来自 AVPlayerItem 的回调中遇到了崩溃。我这样设置通知:

if (queuePlayer==nil) {
queuePlayer = [[AVQueuePlayer alloc] initWithItems:playerItems];
}
else {
for (AVPlayerItem* item in playerItems) {
[queuePlayer insertItem:item afterItem:nil];
}
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerLastItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[playerItems lastObject]];

[queuePlayer play];
[playerItems release];

我以随机的方式遇到了这个崩溃;这意味着大多数时候代码都可以工作。但它偶尔会生成此堆栈跟踪。

线程 0 名称:调度队列:com.apple.main-thread线程 0 崩溃:

0   libsystem_kernel.dylib          0x30fbd350 __pthread_kill + 8
1 libsystem_c.dylib 0x3916a11e pthread_kill + 54
2 libsystem_c.dylib 0x391a696e abort + 90
3 libc++abi.dylib 0x32515d4a abort_message + 70
4 libc++abi.dylib 0x32512ff4 default_terminate() + 20
5 libobjc.A.dylib 0x336c9a74 _objc_terminate() + 144
6 libc++abi.dylib 0x32513078 safe_handler_caller(void (*)()) + 76
7 libc++abi.dylib 0x32513110 std::terminate() + 16
8 libc++abi.dylib 0x3251450e __cxa_throw + 118
9 libobjc.A.dylib 0x336c99ba objc_exception_throw + 90
10 CoreFoundation 0x353bce02 -[NSObject(NSObject) doesNotRecognizeSelector:] + 166
11 CoreFoundation 0x353bb52c ___forwarding___ + 388
12 CoreFoundation 0x35312f64 _CF_forwarding_prep_0 + 20
13 CoreFoundation 0x3530a034 _CFXNotificationPost + 1424
14 AVFoundation 0x317e6d60 __avplayeritem_fpItemNotificationCallback_block_invoke_0 + 3364
15 libdispatch.dylib 0x340aa11c _dispatch_call_block_and_release + 8
16 libdispatch.dylib 0x340a94b4 _dispatch_client_callout + 20
17 libdispatch.dylib 0x340ae1b8 _dispatch_main_queue_callback_4CF$VARIANT$mp + 220
18 CoreFoundation 0x3538cf36 __CFRunLoopRun + 1286
19 CoreFoundation 0x352ffeb8 CFRunLoopRunSpecific + 352
20 CoreFoundation 0x352ffd44 CFRunLoopRunInMode + 100
21 GraphicsServices 0x3583c2e6 GSEventRunModal + 70
22 UIKit 0x366de2fc UIApplicationMain + 1116
23 Training 0x0004399a main (main.m:14)
24 Training 0x0004395c start + 36

最佳答案

看起来您的对象实际上没有playerLastItemDidReachEnd:选择器。

关于ios - 与 avplayeritem 的 doesNotRecognizeSelector 一起崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15346250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com