• 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: How to write a dictionary into an output file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to write a dictionary into an output file


  • Subject: Re: How to write a dictionary into an output file
  • From: j o a r <email@hidden>
  • Date: Tue, 6 Jun 2006 16:17:57 +0200


On 6 jun 2006, at 16.07, Julio Bianco wrote:

You tell me this dictionary was not properly set up, then how can I set it up to be written correctly taking in consideration that I'm not using any estrange class or object, but a string and an integer as key an value? I don't know if I need to do something else I am not performing, because I have exactly that I send you, and it doesn't work.

The keys needs to be strings when using property list serialization. Change your code to something like this:


	NSDictionary *LogFile1 = [[NSDictionary alloc] initWithObjectsAndKeys:
		@"one", [NSString stringWithFormat: @"%d", 1],
		nil];

It's not obvious that it should work this way, as NSNumber is also a valid property list class, but at least it's (now) a documented limitation:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ PropertyLists/Concepts/AboutPropertyLists.html#//apple_ref/doc/uid/ 20001010-BBCBDBJE>

j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >How to write a dictionary into an output file (From: Julio Bianco <email@hidden>)
 >Re: How to write a dictionary into an output file (From: "Nick Kreeger" <email@hidden>)
 >Re: How to write a dictionary into an output file (From: Julio Bianco <email@hidden>)

  • Prev by Date: RE: Re: My app does not display its version in the finder
  • Next by Date: Re: Fastest way to "ExpandAll" in NSOutlineView
  • Previous by thread: Re: How to write a dictionary into an output file
  • Next by thread: Re: How to write a dictionary into an output file
  • Index(es):
    • Date
    • Thread