ios - What is interpretation for bundleForClass returns nil and how that can be corrected? -


i preparing xctest , perform test need load resource test bundle. therefore use:

nsbundle *bundle = [nsbundle bundleforclass:[self class]]; nsstring *path = [bundle pathforresource:@"item" oftype:@"plist"]; 

the problem bundleforclass returns nil. how can happening, every class tied bundle loaded from? there setting corrected make working?

you can like,

nsstring *path = [[nsbundle mainbundle] pathforresource:@"item" oftype:@"plist"]; 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -