I'd like to assign a boolean value to a plist file entry. I'm doing the following:
NSString *aBool = realBoolValue ? @"YES" : @"NO";
[myplist setValue: aBool forKey:@"boolKey"];
[myplist writeToFile: [NSHomeDirectory() stringByAppendingPathComponent: plistFilePath] atomically:NO];
But the assignment never takes. I'm doing the above because the following doesn't work:
[myplist setValue: realBoolValue forKey:@"boolKey"];
It gives an incompatible type error. What am I doing wrong?
-- EDIT ---
plistFilePath is initialized as
plistFilePath = [NSHomeDirectory() stringByAppendingPathComponent: @"Library/Preferences/myfile.plist"];