how to store a uint32_t in a plist

Go To StackoverFlow.com

1

I have a plist where I would like to save a some response details from my server too, however the variables are of type uint32_t and plists do not have a whole lot of type options to choose from other than, number - string - array - dictionary etc.

so what is the best course of action? conversion? if so how would I go about doing this.

2012-04-03 19:34
by C.Johns


1

[ NSNumber numberWithInt: value ]
2012-04-03 19:38
by DRVic
perfect.. thanks for that - C.Johns 2012-04-03 19:52


4

When decoding, integer will automatically choose the best size, be it 32 or 64 bits. When encoding, you should specifically call [NSNumber numberWithUnsignedInt: ...] or a similar method to create an NSNumber of the right size. However, it will be encoded as integer anyway.

2012-04-03 19:42
by Costique


0

how to write an integer to a plist can be found here: http://ipgames.wordpress.com/tutorials/writeread-data-to-plist-file/

2012-04-03 19:37
by Sebastian Flückiger