NSString *levelPlist = [[NSBundle mainBundle]pathForResource:[NSString stringWithFormat:@"Level%d", level] ofType:@"plist"];
NSDictionary *levelData = [NSDictionary dictionaryWithContentsOfFile:levelPlist];
When I load plist like this, levelPlist
is just a (null).
stringWithFormat
syntax is wrong?
As always when debugging break the problem down,first get the file name, then loading the file contents.
Then NSLog()
the file name and verify that a file with that name exists directly in the app bundle. Do that by actually looking in the app file.
Safe bet: It the file with the formatted names and extension does not exist directly in the app bundle.
Possibilities: