将spotify uri列表添加到spotify播放列表中

时间:2015-12-27 07:37:59

标签: ios swift spotify

您好我正在尝试添加歌曲列表以进行spotify,列表包含在tracksUri中,在调用SPTTrack.trackswithURIs后,预计会返回一个曲目数组,然后可以使用SPTPlaylistSnapshot addTracksToPlaylist方法添加到spotify中。我哪里错了?

SPTTrack.tracksWithURIs(tracksUri as [AnyObject], session: session, callback: {
        (error, objects) in
        if (error == nil) {
            let myArray:NSArray = objects as AnyObject! as! NSArray
            list.addTracksToPlaylist(myArray as [AnyObject], withSession: session, callback: {
                (error) in
                if (error == nil) {
                    self.saveSongs()
                }
            })

        }
    })

0 个答案:

没有答案