Question

I am using CocoaLibSpotify in my app, the app uses storyboard. When I try to present the loginviewcontroller like this:

[self presentViewController:[SPLoginViewController loginControllerForSession:[SPSession sharedSession]] animated:YES completion:nil];

I get this error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'

In this file: SPLoginViewController

And this line:

NSURL *bundlePath = [[NSBundle mainBundle] URLForResource:@"SPLoginResources" withExtension:@"bundle"];
NSBundle *resourcesBundle = [NSBundle bundleWithURL:bundlePath];

What could cause this error?

Was it helpful?

Solution

As described in the CocoaLibSpotify ReadMe under the "Building - iOS" section, you must include the SPLoginResources.bundle bundle supplied with the library in your project.

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