Xcode 7 / Swift 2调用中的额外参数'错误'

时间:2015-07-10 20:45:41

标签: ios iphone xcode swift

通话中的额外参数'错误'

我的代码:

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()
    }!

ScreenShot from Xcode (ErrorLog)

0 个答案:

没有答案