Re: drag and drop sample is incorrect: it does not use the pasteboard contents
Re: drag and drop sample is incorrect: it does not use the pasteboard contents
- Subject: Re: drag and drop sample is incorrect: it does not use the pasteboard contents
- From: Alex Rice <email@hidden>
- Date: Thu, 6 Feb 2003 12:06:48 -0700
On Thursday, February 6, 2003, at 11:11 AM, Baback Nemazie wrote:
So My question is what is the correct way to post dragged items to the
pasteboard in the drag source, and read them off the pasteboard in the
drop source.
I think the sample code not ideal, but is OK as long as you don't care
about ever using dragged data outside your application - or even
outside that class!
The better way, I think, is to use NSArchiver and NSUnarchiver on their
respective sides of the drag/drop operation.
NSData *data = [NSArchiver archivedDataWithRootObject: items];
[pboard setData: data forType:DragDropSimplePboardType];
Alex Rice <email@hidden> | Mindlube Software |
http://mindlube.com
what a waste of thumbs that are opposable
to make machines that are disposable -Ani DiFranco
_______________________________________________
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.