I am trying to get an array from a plist as suggested on an answer here but it's not working. Can someone tell me what I'm missing?
Here is what the plist looks like....another weird thing is that I can't get this to open in a plain text file?? when I do it looks like garbage.....but it looks fine in the property list editor:
<?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>count</key>
<array>
<integer>5</integer>
</array>
<key>username</key>
<array>
<string>johnsmith</string>
</array>
</dict>
</plist>
Here is the code i'm using..... dictionary is a NSMUtableDictionary and accountsArray is an NSMustableArray that are in the .h file.
NSMutableDictionary *tempDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:accountsFilePath];
dictionary = tempDictionary;
[tempDictionary release];
NSMutableArray *nameArray = [[NSMutableArray alloc] init];
nameArray = [dictionary objectForKey:@"username"];
accountsArray = nameArray;
[nameArray release];
Am I missing something? Screwing something up?
Thanks...