Re: Deserializers for NSArray, NSDictionary
Re: Deserializers for NSArray, NSDictionary
- Subject: Re: Deserializers for NSArray, NSDictionary
- From: Marc Respass <email@hidden>
- Date: Thu, 25 May 2006 00:05:58 -0400
I do this except that I pass strings and use
NSPropertyListSerialization. WebObjects creates ASCII plists when you
invoke toString() and Cocoa figures out the format. WebObjects'
NSPropertyListSerialization handles XML and ASCII plists.
NSData *data = [propertyListXML dataUsingEncoding:
NSUTF8StringEncoding];
NSString *errorString = nil;
NSPropertyListFormat format; // will contain the format
id propertyList = [NSPropertyListSerialization propertyListFromData:data
mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:&format
errorDescription:&errorString];
In WebObjects, it's a little easier
Object plist = NSPropertyListSerialization.propertyListFromString
(plistString);
I like this because I stick with a standard built-in WebSerices type
(String) and both frameworks already have serialization and
deserialization built-in so I just use what's there. Don't fight the
frameworks ;).
Marc
On May 24, 2006, at 11:41 AM, Frank Herzog wrote:
Hi all,
I'm trying to build a WO web services application with a Cocoa
client. I pass the data from the server to the client as an NSArray
of NSDictionaries, which works fine. The same approach fails from
the client to the server because, as I guess, the NSArray and
NSDictionary classes do not have deserializers registered. Is there
a workaround for this? Could I somehow create the deserializers by
myself?
Thanks for any help!
Frank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
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