tags:

views:

44

answers:

1

hi,

in my resources directory i have a file called lsf.plist i want to load this file (dictionary) but i always get null as content of the file. i am using the following code. i've verified that the file is in the app after the build.

self.path = [[NSBundle mainBundle] pathForResource:@"lsf" ofType:@"plist"]; 
NSLog(self.path);
self.lsf = [NSMutableArray arrayWithContentsOfFile:path];
NSLog(@"%@",lsf);

The first log-output shows the path and the second one gives me null.... it would be great if you can help me to solve this issue!

Br, martin

+1  A: 

Is root of your plist array or dictionary? Also you dont need to use self. Heres an example from a project of mine:

NSString* path = [[NSBundle mainBundle] pathForResource:@"property" ofType:@"plist"];
NSDictionary *newDict = [NSDictionary dictionaryWithContentsOfFile:path];
totallhellfail