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 |