Problems saving NSDictionary with writeToFile
Problems saving NSDictionary with writeToFile
- Subject: Problems saving NSDictionary with writeToFile
- From: Colin Cornaby <email@hidden>
- Date: Sun, 9 Feb 2003 17:46:44 -0800
I'm having trouble saving a dictionary to an XML plist. I cannot figure
out any reason why the file should not save. Permissions and Path names
are ok, and no exceptions are raised. However, writeToFile returns
false.
Here is the saving code:
-(void)writeAsFileToPath:(NSString *)thePath atomically:(BOOL)atomYN{
NSMutableDictionary *finalDict = [[NSMutableDictionary alloc] init];
[finalDict setObject:theFiles forKey:@"files"];
[finalDict setObject:theThemeNames forKey:@"variations"];
if([finalDict writeToFile:thePath atomically:atomYN]){
}else{
NSLog(@"There was a problem saving the file");
}
[finalDict release];
}
The code always logs the error to the console with the example I am
using, so I know that writeToFile is returning false.
The dictionary itself appears to be fine, and is spilling out a
description properly. I have posted the description of the NSDictionary
online (it is 979 k, but most of the size comes from raw data in the
dictionary, there are not many actual keys).
http://conundrumsoft.com/NSDictProb.html
It is a largely sized dictionary. Could that be the problem?
--Colin Cornaby
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.