我收到此错误:
无法初始化'id'类型的参数 使用'VDLPlaybackViewController * const __strong'
类型的左值
来自这行代码:
[[AVAudioSession sharedInstance] setDelegate:self];
我该如何解决?
答案 0 :(得分:1)
我认为您应该在VDLPlaybackViewController.h
:
@interface VDLPlaybackViewController: UIViewController <AVAudioSessionDelegate>
但AVAudioSessionDelegate
已弃用iOS6
:
/* The delegate property is deprecated. Instead, you should register for the NSNotifications named below. */
/* For example:
[[NSNotificationCenter defaultCenter] addObserver: myObject
selector: @selector(handleInterruption:)
name: AVAudioSessionInterruptionNotification
object: [AVAudioSession sharedInstance]];
*/
@property(assign) id<AVAudioSessionDelegate> delegate NS_DEPRECATED_IOS(4_0, 6_0);
尝试按下此post来初始化声音设置。