Re: Using NSDictionary as attribute
Re: Using NSDictionary as attribute
- Subject: Re: Using NSDictionary as attribute
- From: Robert Walker <email@hidden>
- Date: Fri, 10 Dec 2004 23:23:46 -0500
Yea. It would be great to serialize to XML using some like the example shown in the WO documentation (and in Chuck's "Practical WebObjects" book).
I would be even better is it actually worked in WO 5.2.3.
Here is the sample code from the WO doc:
01 FileOutputStream ostream = new FileOutputStream("t.tmp");
02 NSXMLOutputStream p = new NSXMLOutputStream(ostream);
03 if (p instanceof NSXMLOutputStream) {
04 NSXMLOutputFormat format = new NSXMLOutputFormat();
05 p.setOutputFormat(format);
06 p.writeRootComment("Writing comment", true);
07 }
08
09 p.writeInt(12345);
10 p.writeObject("Today");
11 p.writeObject(new Date());
12
13 p.flush();
14 p.close();
Line 02 will fail with an exception. At least it does for me, and the other developers in my group.
On Dec 10, 2004, at 9:29 PM, Chuck Hill wrote:
I think plist de-serialization treats all values (other than array and
dictionary as String. To preserve object type XML seems like your best
choice. Or use cover methods to access the dictionary contents and
converted the values as needed.
At 05:06 PM 10/12/2004 -0500, Jacky Gagnon wrote:
Hi,
I tried to use an immutable NSDictionnary as attribute. I can write it
to the database in plist format, but I cannot read it correctly. The
problem is with Boolean value in NSDictionary; in the conversion from
plist to NSDictionary, they lost their type and WebObjects created
String from Boolean value in the plist...
Is this a bug with WebObjects, or I cannot use Boolean in NSDictionary
as attribute?
Thanks!
Jacky
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
e.net
This email sent to email@hidden
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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
--
Robert Walker
www.robertwalker1.com
"There are 10 kinds of people in the world. Those who think binary and those who don't."
_______________________________________________
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