2017-02-03 50 views
0

`setSession() UIApplication.shared.beginReceivingRemoteControlEvents() becomeFirstResponder()AVAudion会话中断

NotificationCenter.defaultCenter.addObserver(self, Selector("handleInterruption"), name: AVAudioSessionInterruptionNotification, object: nil) 
     //the Error is the line above this comment 

    player = Player() 

    player.playStream(fileUrl: "http:wwwwww.mp3") 

     updatePlayButton()` 

我试着去检查使用AVAudiointerruptionNotification时,一个电话完成,但我做错了我继续获取参数标签_,_,名称,对象不匹配任何可用的重载...

+0

我试着去检查时,电话已经通过AVAudiointerruptionNotification完成,但我做错事我不断收到参数标签_,_,名称,对象不匹配任何可用的重载... – user3625689

回答

0

在swift 3中使用通知中心的新方法是休闲。我能够编译没有错误或警告!

NotificationCenter.default.addObserver(self, selector: 
    (Selector("handleInterruption")), name: 
    NSNotification.Name.AVAudioSessionInterruption, object: nil)