Hi guys,
I'm testing a plist in a blank project and the code and plist setup is identical to my main project. It works perfectly in my main project, it does not work in my test project and I can't figure out why.
The only difference is my main project is iOS, the test project is only command line using Foundation.
Here is the code I have:
My plist was added to my project with the target of the project name and it is named "Codes.plist".
Is there some fundamental difference between command line and iOS projects that could be causing this? I have the same exact code in another project and it works just fine.
Anyone know why this may be null? I even tried creating a new plist and it doesn't work either. It's in the same spot in the directory as my working projects plist too.
I'm testing a plist in a blank project and the code and plist setup is identical to my main project. It works perfectly in my main project, it does not work in my test project and I can't figure out why.
The only difference is my main project is iOS, the test project is only command line using Foundation.
Here is the code I have:
Code:
NSArray *codes;
NSString *path = [[NSBundle mainBundle]pathForResource:@"Codes" ofType:@"plist"];
NSLog(@"%@", path); //This is null!
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:path];
My plist was added to my project with the target of the project name and it is named "Codes.plist".
Is there some fundamental difference between command line and iOS projects that could be causing this? I have the same exact code in another project and it works just fine.
Anyone know why this may be null? I even tried creating a new plist and it doesn't work either. It's in the same spot in the directory as my working projects plist too.
Last edited: