views:

23

answers:

0

I have a .plist with 2 key values in it. It is of type Dictionary. I am trying to write value to one of the key values. What's wrong with the code below? I also tried using type "Array". That option also does not work. How can I get it to work using Dictionary & also Array? Anyone has working code example? Thanks. I would appreciate any help.

NSString *filePath = @"myprefs.plist";

NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];

[plistDict setValue:@"[email protected]" forKey:@"Email"];

[plistDict writeToFile:filePath atomically: YES];