设置 Spotify API 时无法将类型 'ViewController' 的值分配给类型 'SPTAudioStreamingDelegate!'
Cannot assign value of type 'ViewController' to type 'SPTAudioStreamingDelegate!' When setting up Spotify API
尝试设置 Spotify API 时遇到错误:
"Cannot assign value of type 'ViewController' to type 'SPTAudioStreamingDelegate!'" 在下面的函数中。
我在这里很迷茫,任何帮助将不胜感激。
func initializePlayer(authSession:SPTSession){
if self.player == nil {
self.player = SPTAudioStreamingController.sharedInstance()
self.player!.playbackDelegate = self
self.player!.delegate = self
try! player!.start(withClientId: auth.clientID)
self.player!.login(withAccessToken: authSession.accessToken)
}
}
我的猜测是,您的视图控制器 self
不符合 SPTAudioStreamingDelegate
协议。
https://spotify.github.io/ios-sdk/Protocols/SPTAudioStreamingDelegate.html
class MyViewController : SPTAudioStreamingDelegate {
...
}
尝试设置 Spotify API 时遇到错误: "Cannot assign value of type 'ViewController' to type 'SPTAudioStreamingDelegate!'" 在下面的函数中。
我在这里很迷茫,任何帮助将不胜感激。
func initializePlayer(authSession:SPTSession){
if self.player == nil {
self.player = SPTAudioStreamingController.sharedInstance()
self.player!.playbackDelegate = self
self.player!.delegate = self
try! player!.start(withClientId: auth.clientID)
self.player!.login(withAccessToken: authSession.accessToken)
}
}
我的猜测是,您的视图控制器 self
不符合 SPTAudioStreamingDelegate
协议。
https://spotify.github.io/ios-sdk/Protocols/SPTAudioStreamingDelegate.html
class MyViewController : SPTAudioStreamingDelegate {
...
}