I am trying to execute a single code to load and request data from a plist file. I am loading data with code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"availableshops" ofType:@"plist"];
NSArray *arrayOfShops = [[NSArray alloc] initWithContentsOfFile:path];
When testing the application in the simulator and on the device, everything works. BUT, when I run unit test, the code " [arrayOfShops count]" always returns " 0".
I have the same files in "Copy Bundle Resources", "Compile Sources" and "Link Binary With Libraries" for the main target and target. I also tried with and without a primary goal as “Direct Breaks” for the purpose of unit testing.
Does anyone know what the problem is?
source
share