通话中的额外参数'错误'
我的代码:
AVAudioSession.sharedInstance()。setCategory(AVAudioSessionCategoryPlayback,error:nil)
if NSClassFromString("MPNowPlayingInfoCenter") != nil {
let image:UIImage = UIImage(named: "albumart")!
let albumArt = MPMediaItemArtwork(image: image)
var songInfo: NSMutableDictionary = [
MPMediaItemPropertyTitle: "Radio",
MPMediaItemPropertyArtist: "fm",
MPMediaItemPropertyArtwork: albumArt
]
MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo = songInfo as [NSObject : AnyObject]
}
if (AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, error: nil)) {
print("Receiving remote control events")
UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
}!