Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top