AW: NSDictionary to NSData
AW: NSDictionary to NSData
- Subject: AW: NSDictionary to NSData
- From: Helge Staedtler <email@hidden>
- Date: Thu, 22 Sep 2005 11:57:03 +0200
yeah, thats also a good alternative. I practiced it in one project for
exactly the mentioned problem (saving it as CLOB in the DB)
object-serialization ist a good thing. But you have to be very very careful
if you change one of the classes which get serialized. There exist some
restrictions:
1) If you rename a class or the package-name/location of an object which got
serialized you will not be able to unserialize it under the new name. so in
a way you trade off some inflexibility here. using XML will give you more
flexibility but also more coding-overhead.
2) if you add class-variables to a class which will be used for
serialization declare them as "transient" otherwise they get serialized too,
and older serialized objects won't unserialize any longer ('cause the
class-var-signature does not fit any longer).
good thing is: serialization produces smaller files/data then XML.
regards,
helge
Am 22.09.2005 11:01 Uhr schrieb "Wolfram Stebel" unter
<email@hidden>:
> Am 22.09.2005 8:06 Uhr schrieb "Dave Elsner" unter <email@hidden>:
>
>> Hi,
>>
>> Does any one know an easy way of converting an NSDictionary to
>> NSData and back again. The reason being I would like to store a
>> Dictionary in the DB as a blob.
> I never did it and i did no research on it, but could you serialize it?
>
> Wolfram
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Helge Städtler
- Expect and Respect.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden