• 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
Re: Problems saving NSDictionary with writeToFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems saving NSDictionary with writeToFile


  • Subject: Re: Problems saving NSDictionary with writeToFile
  • From: mw <email@hidden>
  • Date: Sun, 09 Feb 2003 21:10:29 -0500

Did you check to see if the dictionary was being written to file? Perhaps
you should check "thePath" to see if the xml file exists. Also, are you 100%
sure that the path is valid? I have never had any problems with this method
before.

mw

--
"Software exists to solve your problems. We exist to make the problems."
Microsoft


On 2/9/03 8:46 PM, "Colin Cornaby" <email@hidden> wrote:

> 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: Colin Cornaby <email@hidden>
References: 
 >Problems saving NSDictionary with writeToFile (From: Colin Cornaby <email@hidden>)

  • Prev by Date: Re: Using Quicktime for Java in Cocoa.
  • Next by Date: Re: IB Palette for "Metal" look?
  • Previous by thread: Problems saving NSDictionary with writeToFile
  • Next by thread: Re: Problems saving NSDictionary with writeToFile
  • Index(es):
    • Date
    • Thread