Subclassing NSMutableDictionary
Subclassing NSMutableDictionary
- Subject: Subclassing NSMutableDictionary
- From: ".::welemski::." <email@hidden>
- Date: Mon, 18 Aug 2008 11:07:28 +0800
Hi Lists,
I tried subclassing NSMutableDictionary and called it MyDictionary.
The reason I subclassed it is because I want to create an accessible
values without declaring the keys.
e.g., Instead of calling the method
MyDictionary.objectForKey("username") I just use this
MyDictionary.username() and everything works fine according to plan.
However, when I tried to encode my MyDictionary object to xml using
WOXMLCoder the result is an encoded XML string of MyDictionary object
in the form of NSDictionary not NSMutableDictionary. Take a look at
this serialized form:
<ROOT type="com.webobjects.foundation.NSDictionary" objectID="1">
<USERNAME type="java.lang.String" objectID="2">myusername</USERNAME>
</ROOT>
So it means in order for me to convert the XML string to MyDictionary
i have to decode to it to an object of type NSDictionary then add
those keys in my MyDictionary object of type NSMutableDictionary.
How come WOXMLCoder is not able to detect that MyDictionary is a
subclass of NSMutableDictionary?
Thanks in advance.
--
-- -- -- -- -- -- -- -- -- -- --
welemski
-- -- -- -- -- -- -- -- -- -- --
_______________________________________________
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