• 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
Dictionary won't write to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dictionary won't write to disk


  • Subject: Dictionary won't write to disk
  • From: Dave DeLong <email@hidden>
  • Date: Wed, 8 Jun 2005 20:49:00 -0500

Hi Everyone,

I'm writing a program that has me dealing with dictionaries that contain thousands of K/V pairs.  As I was working along, I came across a manipulation of one of my dictionaries that was coming back empty, which it shouldn't be.

So I decided to try and write my main dictionary to disk so I could inspect the structure to make sure everything was ok.  (NSLog([myDictionary description]) would be horribly impractical -- my dictionary has 3300+ entries, each of which is another dictionary with about 20 entries)

So I put in the line:

if ([myDictionary writeToFile:[@"~/Desktop/Songs.xml" stringByExpandingTildeInPath] atomically:NO]) {}

Unfortunately, nothing is happening!  I've tried many different things like changing "atomically" to YES, putting it into a brand new dictionary via:

NSDictionary *temp = [[NSDictionary alloc] initWithDictionary:myDictionary copyItems:YES];

and then trying to write THAT dictionary.  I've also tried using writeToURL and also taking it out of the if() statement, but nothing works.

The only idea I have is that my huge 2D enumeration shortly thereafter is clogging up the computer somehow so that it can't be written (enumerate through an NSArray, each object of which has an NSArray that I enumerate through).

Any ideas on how I can dump my dictionary to a file?

Thanks!

Dave
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dictionary won't write to disk
      • From: Todd Blanchard <email@hidden>
    • Re: Dictionary won't write to disk
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: document shading
  • Next by Date: Re: Dictionary won't write to disk
  • Previous by thread: Re: DnD Core Data objects?
  • Next by thread: Re: Dictionary won't write to disk
  • Index(es):
    • Date
    • Thread