I'm learning how to use plist files for storing data in my iPhone app. I've been reading a bunch of the questions about plist and dictionaryWithContentsOfFile on this site, but can't see what I'm doing wrong.
The following line returns nil ("The dictionary is null" to the console).
NSLog(@"The dictionary is %@",[NSDictionary dictionaryWithContentsOfFile:@"myFile"]);
The myFile.plist file is in the resources folder, and contains a few strings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>john</string>
<key>aname</key>
<string>jen</string>
</dict>
</plist>
Am I missing something here?
[NSBundle mainBunde]
, of course) and build their own resource-paths... – Hawk