On Tue, Mar 24, 2009 at 8:39 AM, Peter Zegelin
<pe...@fracturedsoftware.com> wrote:

>        [value description] gives just  a string <................> with
> nothing obvious in it.

  This is basic Cocoa 101:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html

  Also look at the -description method here:

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html


> So how do I  transform whatever value is into an NSData object for
> archiving?

  You haven't mentioned whether you've read this:

http://developer.apple.com/documentation/Cocoa/Conceptual/ValueTransformers/ValueTransformers.html

  Essentially, you should already know what kinds of objects to
expect, what to convert, and what to ignore. If you expect to receive
more than one type (and you shouldn't with an NSImageView, since it
won't let you insert anything other than an NSImage or nil), then you
can ask it for its -class or -className to figure out what it is and
what to do with it.

  In your case, you should probably only be checking for nil (and
returning nil or the [NSNull null] placeholder in kind) or, if it's an
image, archive it and return the NSData object, or vice-versa
(depending on which direction is "reverse" for you).

  Since you haven't provided a full code listing, I can't tell if
you're missing anything else.

--
I.S.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to