AVAudioPlayer 一直在这条线上崩溃? (初始化)
我的 AVAudioPlayer 不断在 error:nil 行崩溃:
AVAudioRecorder *tempRecorder = [[AVAudioRecorder alloc]
initWithURL:nil
settings:nil
error:nil];
我尝试将其设置为非零值,但它仍然在该特定行崩溃!
这是堆栈跟踪:
#0 0x00e0ed65 in CFEqual ()
#1 0x00e69e86 in CFArrayGetFirstIndexOfValue ()
#2 0x0158cda8 in AudioFileFormatRegistry::GetTypesForExtension(__CFString const*, unsigned long*, void*) ()
#3 0x0158eb5c in AudioFileGetGlobalInfoSize ()
#4 0x00cc8e6a in -[AVAudioRecorder initWithURL:settings:error:] ()
#5 0x000033f7 in -[RecorderVC resetRecorder] at /Users/Ahmed/Documents/AudioRecorder/AudioRecorder/RecorderVC.m:52
#6 0x000031d3 in -[RecorderVC viewDidLoad] ()
#7 0x000c4089 in -[UIViewController view] ()
#8 0x000d6f54 in -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] ()
#9 0x000d5aaa in -[UITabBarController transitionFromViewController:toViewController:] ()
#10 0x000d78a2 in -[UITabBarController _setSelectedViewController:] ()
#11 0x000d7d5e in -[UITabBarController viewWillLayoutSubviews] ()
#12 0x001e82e9 in -[UILayoutContainerView layoutSubviews] ()
#13 0x017e1a5a in -[CALayer layoutSublayers] ()
#14 0x017e3ddc in CALayerLayoutIfNeeded ()
#15 0x017890b4 in CA::Context::commit_transaction(CA::Transaction*) ()
#16 0x0178a294 in CA::Transaction::commit() ()
#17 0x000169c9 in -[UIApplication _reportAppLaunchFinished] ()
#18 0x00016e83 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#19 0x00021617 in -[UIApplication handleEvent:withNewEvent:] ()
#20 0x00019abf in -[UIApplication sendEvent:] ()
#21 0x0001ef2e in _UIApplicationHandleEvent ()
#22 0x01130992 in PurpleEventCallback ()
#23 0x00ed8944 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#24 0x00e38cf7 in __CFRunLoopDoSource1 ()
#25 0x00e35f83 in __CFRunLoopRun ()
#26 0x00e35840 in CFRunLoopRunSpecific ()
#27 0x00e35761 in CFRunLoopRunInMode ()
#28 0x000167d2 in -[UIApplication _run] ()
#29 0x00022c93 in UIApplicationMain ()
#30 0x00002a39 in main ()
My AVAudioPlayer keeps crashing at the error:nil line:
AVAudioRecorder *tempRecorder = [[AVAudioRecorder alloc]
initWithURL:nil
settings:nil
error:nil];
I tried setting it to a non-nil value, but still, it keeps crashing at that specific line!
Here's the stack trace:
#0 0x00e0ed65 in CFEqual ()
#1 0x00e69e86 in CFArrayGetFirstIndexOfValue ()
#2 0x0158cda8 in AudioFileFormatRegistry::GetTypesForExtension(__CFString const*, unsigned long*, void*) ()
#3 0x0158eb5c in AudioFileGetGlobalInfoSize ()
#4 0x00cc8e6a in -[AVAudioRecorder initWithURL:settings:error:] ()
#5 0x000033f7 in -[RecorderVC resetRecorder] at /Users/Ahmed/Documents/AudioRecorder/AudioRecorder/RecorderVC.m:52
#6 0x000031d3 in -[RecorderVC viewDidLoad] ()
#7 0x000c4089 in -[UIViewController view] ()
#8 0x000d6f54 in -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] ()
#9 0x000d5aaa in -[UITabBarController transitionFromViewController:toViewController:] ()
#10 0x000d78a2 in -[UITabBarController _setSelectedViewController:] ()
#11 0x000d7d5e in -[UITabBarController viewWillLayoutSubviews] ()
#12 0x001e82e9 in -[UILayoutContainerView layoutSubviews] ()
#13 0x017e1a5a in -[CALayer layoutSublayers] ()
#14 0x017e3ddc in CALayerLayoutIfNeeded ()
#15 0x017890b4 in CA::Context::commit_transaction(CA::Transaction*) ()
#16 0x0178a294 in CA::Transaction::commit() ()
#17 0x000169c9 in -[UIApplication _reportAppLaunchFinished] ()
#18 0x00016e83 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#19 0x00021617 in -[UIApplication handleEvent:withNewEvent:] ()
#20 0x00019abf in -[UIApplication sendEvent:] ()
#21 0x0001ef2e in _UIApplicationHandleEvent ()
#22 0x01130992 in PurpleEventCallback ()
#23 0x00ed8944 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#24 0x00e38cf7 in __CFRunLoopDoSource1 ()
#25 0x00e35f83 in __CFRunLoopRun ()
#26 0x00e35840 in CFRunLoopRunSpecific ()
#27 0x00e35761 in CFRunLoopRunInMode ()
#28 0x000167d2 in -[UIApplication _run] ()
#29 0x00022c93 in UIApplicationMain ()
#30 0x00002a39 in main ()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能为
initWithURL:
传递nil
。请参阅:http://developer.apple。 com/library/ios/#documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html
You can't pass
nil
forinitWithURL:
. See:http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html