iOS 10 [AVAudioSession privateInterruptionWithInfo:]崩溃

时间:2016-11-19 06:09:53

标签: ios10 avaudiosession

新版本在iOS 10上发生了大量崩溃。

消息是

  

SEGV_ACCERR

     

libobjc.A.dylib objc_msgSend

有两种崩溃。

1:

libobjc.A.dylib objc_msgSend + 16
AVFAudio    -[AVAudioSession privateInterruptionWithInfo:] + 172
AVFAudio    (anonymous namespace)::HandlePropertyListenerCallback(unsigned int, objc_selector*, NSObject*) + 92
libdispatch.dylib   __dispatch_call_block_and_release + 24
libdispatch.dylib   __dispatch_client_callout + 16
libdispatch.dylib   _dispatch_main_queue_callback_4CF + 1000
CoreFoundation  ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
CoreFoundation  ___CFRunLoopRun + 1660
CoreFoundation  CFRunLoopRunSpecific + 444
GraphicsServices    GSEventRunModal + 180
UIKit   -[UIApplication _run] + 684
UIKit   UIApplicationMain + 208
MyApplication   main (main.m:16)
libdyld.dylib   _start + 4

2:

libobjc.A.dylib objc_msgSend + 28
libAVFAudio.dylib   -[AVAudioSession privateBeginInterruption] + 60
Foundation  ___NSThreadPerformPerform + 340
CoreFoundation  ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
CoreFoundation  ___CFRunLoopDoSources0 + 412
CoreFoundation  ___CFRunLoopRun + 724
CoreFoundation  CFRunLoopRunSpecific + 384
GraphicsServices    GSEventRunModal + 180
UIKit   UIApplicationMain + 204
MyApplication   main (main.m:16)
libdyld.dylib   _start + 4

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

委托属性已在AVAudioSession中弃用,并已替换为通知AVAudioSessionInterruptionNotification。所以请使用委托属性注册来获取此通知。图片描述AVAudioSession.h -

标题中的相同图片

AVAudioSession_Deprecated_Delegate_Property_iOS_10_