• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems saving NSDictionary with writeToFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Problems saving NSDictionary with writeToFile
      • From: mw <email@hidden>
  • Prev by Date: IB Palette for "Metal" look?
  • Next by Date: Re: IB Palette for "Metal" look?
  • Previous by thread: Re: IB Palette for "Metal" look?
  • Next by thread: Re: Problems saving NSDictionary with writeToFile
  • Index(es):
    • Date
    • Thread