SetObjectValue

10 views
Skip to first unread message

Appu

unread,
Oct 17, 2008, 3:24:53 AM10/17/08
to KissXML
Hi,

I am KissXMl for my development. I want to use setObjectVålue
method. But presently kissXML is not providing implementation for
that. Could you please provide info n how to proceed?

- Appu.

Robbie Hanson

unread,
Oct 17, 2008, 1:34:54 PM10/17/08
to kis...@googlegroups.com
Hi Appu,

The setObjectValue: and objectValue: methods are mainly used to allow
one to set and retrieve non-string data. They're basically like
shortcuts. Eg:

NSXMLElement *element = [NSXMLElement elementWithName:@"dateCreated"];
[element setObjectValue:[NSDate date]];

This will give you an element like this:
<dateCreated>2008-10-17T17:25:47</dateCreated>

If you're just passing normal strings to the setObjectValue: method, I
believe you can simply replace the method calls with setStringValue:

The reason I didn't implement objectValue: and setObjectValue: is
because I had never used them before, and I wasn't completely sure I
could get the implementation right. Apple's documentation states that
it must support at least these types:

NSNumber
NSString
NSCalendarDate
NSData
NSURL
NSArray

From the example above I know it must also support NSDate.
Also, according to the documentation, one should be able to register
value transformers, and have those automatically convert objects to
and from XML strings.

Let me know how it is you're using the setObjectValue: method. Also,
let me know if you have any good ideas on how to implement these
methods. Perhaps we can work together to get this implemented for the
Mac development community.

-Robbie Hanson
-Deusty Designs
Reply all
Reply to author
Forward
0 new messages