NSBundle pathForResource is NULL

So here’s the solution for this problem after I got the source:

I didn’t really pay attention to the posted screenshot, but the target is of type “Command-line Tool“… and since those don’t have a bundle [NSBundle mainBundle] of course returns nil. It’s pretty misleading that Xcode doesn’t complain that it can’t execute the “Copy Bundle Resources” step, it just silently skips it.

Solution is simply to add a new target, of type “Application” so a bundle-based application is generated. Then check the Target Membership checkboxes for all sources and resources for this new target. The plist paths are correctly resolved then.

Leave a Comment