I get an assertion failure testing for favorite COCOA API wrapper(objective-c)

33 views
Skip to first unread message

trevor jordet

unread,
Mar 6, 2012, 12:50:02 PM3/6/12
to soundc...@googlegroups.com

NSString *urlString = [NSString stringWithFormat:@"users/%@/favorites/%@",[self.model.userDictionary objectForKey:@"id"],[self.model.currentTrackDictionary objectForKey:@"id"]];
    NSLog(@"%@",urlString); //this correctly displays: users/427037/favorites/28176691
    id obj;
    obj = [SCRequest performMethod:SCRequestMethodGET
                        onResource:[NSURL URLWithString:urlString]
                   usingParameters:nil
                       withAccount:[SCSoundCloud account]
            sendingProgressHandler:nil
                   responseHandler:^(NSURLResponse *response, NSData *data, NSError *error){
                       if (error) {
                           NSLog(@"Ooops, something went wrong: %@", [error localizedDescription]);
                       } else {
                          //handle response here
                       }


the error I get is: *** Assertion failure in +[SCRequest performMethod:onResource:usingParameters:withAccount:sendingProgressHandler:responseHandler:], /Users/tjordet/Desktop/switchName/CocoaSoundCloudDemo/CocoaSoundCloudAPI/Sources/SoundCloudAPI/SCRequest.m:71

can anyone see what I am doing wrong here?

trevor jordet

unread,
Mar 6, 2012, 12:56:45 PM3/6/12
to soundc...@googlegroups.com

I figured it out  I needed to add https://api.soundcloud.com/ to the urlString

Reply all
Reply to author
Forward
0 new messages