CocoaLibSpotify crashes the app immediately after Login. NSURL Extensions seem to be missing?

StackOverflow https://stackoverflow.com/questions/21310476

  •  01-10-2022
  •  | 
  •  

質問

I'm building a new spottily app using cocoaLibSpotify. Immediately after instantiating the session with initializeSharedSessionWithApplicationKey, I call attemptLoginWithUserName with a valid username/password pair. The app then immediately crashes with

+[NSURL urlWithSpotifyLink:]: unrecognized selector sent to class 0x23e826c
2014-01-23 14:05:09.476 MercuryDockAssistant[44744:3f03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSURL urlWithSpotifyLink:]: unrecognized selector sent to class 0x23e826c'
*** First throw call stack:
(0x22c2012 0x20e7e7e 0x234d2ad 0x22b1bbc 0x22b194e 0x44196 0x43d46 0x35aac 0x4398c 0x3305c 0x2e50d 0x2281920 0x2244d31 0x2268724 0x2267f44 0x2273f91 0x2e7d5 0xcd20d5 0xcd2034 0x2d0c5fb 0x2d0c485 0x2d11cf2)
libc++abi.dylib: terminate called throwing an exception

So it looks like the NSURL extensions are not being recognised. Any ideas?

役に立ちましたか?

解決

Ensure you are importing the header wherever you are using spotify extensions like urlWithSpotifyLink:.

#import "CocoaLibSpotify.h"

Also, as mentioned in the CocoaLibSpotify readme, you need to add the -ObjC and -all_load flags to the "Other Linker Flags" build setting in Xcode.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top