On 27/04/2010, at 5:05 PM, Billy Flatman wrote:

> Hi Jens,
> 
> Thanks for your help. I've been trying to get the option 1 approach to work, 
> but I don't know what I'm meant to do with my NSValue. I can't find how to 
> convert it to an NSData type.


NSData* data = [NSKeyedArchiver archivedDataWithRootObject:myValue];

>> (3) Implement a way to serialize the object into data or a dictionary/array. 
>> Implementing the NSCopying protocol is a standard way to do that.


I think perhaps Jens meant SCoding, not NSCopying. If you have an object that 
you want to be able to cut/paste or drag, adopt the NSCoding protocol and 
archive it directly (as above, but don't bother with a NSValue).

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to