Preserving types in propertyLists
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.