質問

I'm building an iOS application which implements the Spotify API (and am using CocoaLibSpotify). I'm using SPLoginViewController for login so the user can perform an SPSearch. The SPLoginViewController presents itself correctly and the SPSession is active; however, whenever I enter in (valid) credentials for login, the app crashes and the console shows:

+[NSURL urlEncodedStringForString:]: unrecognized selector sent to class 0x274cd14

I set an exception breakpoint. Here's the block where the error occurs, with the specific line put in ** (towards bottom of block):

-(void)loadUserData {

    SPAssertOnLibSpotifyThread();

    BOOL userLoaded = sp_user_is_loaded(self.user);
    NSURL *url = nil;
    NSString *canonicalString = nil;
    NSString *displayString = nil;

    if (userLoaded) {

        sp_link *link = sp_link_create_from_user(self.user);
        if (link != NULL) {
            **url = [NSURL urlWithSpotifyLink:link];**
            sp_link_release(link);
        }

Any ideas? Thanks for any help.

役に立ちましたか?

解決

As mentioned in the "Building - iOS" section of the readme file, make sure you add -ObjC to the "Other Linker Flags" build setting of your project.

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