Take the 2-minute tour ×  I'm using XCode 4.  Can someone please
explain to me why when I have written a unit test (under the
test target) that it can't find my local file resource? I'm
trying to load a plist file from the NSBundle in a unit test but
it doesn't work in the unit test target. I've tried throwing it
under the Classes area of the Test target.  Here's my code:
NSString *path = [[NSBundle mainBundle] bundlePath]; NSString
*finalPath = [path
stringByAppendingPathComponent:@"urlMappings.plist"];
self.urlMappings  = [NSDictionary
dictionaryWithContentsOfFile:finalPath];  self.urlMappings is
empty for some reason even though urlMappings.plist definately
exists in my project. Here is the source to urlMappings.plist to
prove it is in fact a dictionary.  <plist version="1.0">  Any
ideas? Thankyou  share|improve this question Building off of
MikeSimmons's solution, I came up with the following Xcode: TEST
vs DEBUG preprocessor macros. –  MattDiPasquale Jul 20 '11 at
14:40 add comment  2 Answers  up vote 3