문제

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.

도움이 되었습니까?

해결책

[ NSNumber numberWithInt: value ]

다른 팁

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.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top