Re: Drag and drop custom classes
Re: Drag and drop custom classes
- Subject: Re: Drag and drop custom classes
- From: jerome LAURENS <email@hidden>
- Date: Thu, 11 Jul 2002 13:20:40 +0200
Le jeudi 11 juillet 2002, ` 12:07 PM, David H a icrit :
I'm trying to implement the ability to drag and drop objects
instantiated from a class I created, but having trouble doing so. The
program is a window with two tables, each showing the contents of its
own NSMutableArray that contains objects of the custom class. I want to
be able to drag and drop between the tables, and the objects will be
moved between the two arrays.
I can do this for NSStrings, but having trouble working out how to do
it for my custom class. I had a look at setData:forType: but it seems
that only deals with NSData objects. Can anyone provide any clues?
Thanks.
you should archive your object using +[NSArchiver
archiveDataWithRootObject: myObject] to have a NSData.
You must also tell how your object should be (un)archived implementing
the NSCoding protocol
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.