2014-12-08 2 views
0

После обновления IOS SDK от Beta 5 до Beta 6 Я получаю эту ошибку:Spotify IOS SDK Beta 6 ошибок на строительство SPTAudioStreamingController

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SPTAudioStreamingController initWithClientId:]: unrecognized selector sent to instance 0x7a3f15a9740'

Линия, которая, кажется, дает ошибку, это один:

self.player = SPTAudioStreamingController(clientId: "my client id") 

В бета-версии 5 нет необходимости предоставлять clientId. После обновления я добавил строку customerId и получил ошибку выше.

Обратите внимание, что тот же самый код (без аргумента customerId) работал с бета-версией 5. Я получаю ту же ошибку, независимо от того, какую строку я предоставляю. Это ошибка, связанная с SDK? SDK в Свифт? Или мне нужно делать дополнительные вещи после обновления до бета-версии 6?

+0

Я думаю, вы должны проверить [вопросы страницы репо GitHub] (https://github.com/spotify/ios-sdk/issues) и добавить новый, если вы видите, что никто еще не сообщил об этом. –

ответ

0

Обновление Xcode (6.2) и Spotify iOS SDK (бета-версия 7) устранили проблему. Не знаю, почему.

https://github.com/spotify/ios-sdk/issues/195

I made it work now and I assume that there was an error in Beta 6 or maybe in the previous Xcode version. I still think that the errors are a bit misleading so I decided to write what happened for me.

After upgrading to iOS SDK Beta 7 and upgrading Xcode to version 6.2 I created a new project in swift. Writing var a = SPTAudioStreamingController() created an error saying "...use initWithClientId".

I assumed I should try this instead var a = SPTAudioStreamingController.initWithClientId("client-id-string") but this showed another error saying the method doesn't exist.

I was confused for a while since I forgot to add the client ID in the constructor. This is how it should be: var a = SPTAudioStreamingController(clientId: "client-id-string")

I hope this helps someone else in the future.

+0

@kleopatra Спасибо, что указали это. Я обновил ответ. Я считаю, что нынешний формат соответствует руководящим принципам. – rahmen86

Смежные вопросы