2017-02-03 48 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)