Reputation: 1873
I have a such bundle structure:
bundle's root
------atlases
------------en.lproj
--------------------test-hd.plist
------------es.lproj
--------------------test-hd.plist
But when I'm trying to get test-hd.plist for current localization using this code
[[NSBundle mainBundle] pathForResource:@"test-hd.plist" ofType:nil inDirectory:@"atlases"]
it always returns nil. Where is my mistake? How can I fix it?
P.S. "atlases" folder is added as folder reference and test-hd.plist is always available by straight path [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"atlases/en.lproj/test-hd.plist"]
Upvotes: 0
Views: 237
Reputation: 410582
Your directory structure is wrong. en.lproj
, etc., should contain a directory called atlases
, like this:
<bundle root>
|-- en.lproj
|---- atlases
|------ test-hd.plist
|-- es.lproj
|---- atlases
\------ test-hd.plist
Upvotes: 1