• 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
Preserving types in propertyLists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preserving types in propertyLists


  • Subject: Preserving types in propertyLists
  • From: John Lombardo <email@hidden>
  • Date: Fri, 7 May 2004 03:20:30 +0800

For a project I'm working on I have to be able to convert data structures to and from text, and Cocoa's -propertyList and -description methods are great for this. In the interest of dramatically reducing file size, I've been using the propertylist shorthand format rather than complete XML, however recently I've run in to an issue with needing to preserve the datatypes for floats and integers. I can reset this manually after the data has been read in by iterating through the data structure, however this is an evil cludge that I envisage will eventually break my program.

What I would like to know is, is there a way to emulate this:
<dict>
<key>aKey</key>
<Integer>1024</integer>
</dict>

in this format:
{aKey=1024;} <- "1024" is read in as a string.

If there is a way to use the second format to represent integers and floats as NSNumbers, that would make my job better :)

Cheers,
john
_______________________________________________
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: Preserving types in propertyLists
      • From: Allan Odgaard <email@hidden>
    • Re: Preserving types in propertyLists
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Binding Question
  • Next by Date: User defaults not setting...
  • Previous by thread: Loosely in the Window Menu with Diamonds
  • Next by thread: Re: Preserving types in propertyLists
  • Index(es):
    • Date
    • Thread