ADC Home > Reference Library > Technical Q&As > Cocoa > Interapplication Communication >

How to add other pasteboard types to an HFS Promise drag in Cocoa


Q: How do you add other pasteboard types to an HFS Promise drag in Cocoa?

A: NSView's -dragPromisedFilesOfTypes:fromRect:source:slideBack:event: method doesn't provide a means to add other pasteboard types to the HFS Promise data, because it doesn't expose the pasteboard that it uses. However, there is a workaround to add other pasteboard type data. -dragPromisedFilesOfTypes:fromRect:source:slideBack:event: calls NSView's -dragImage:at:offset:event:pasteboard:source:slideBack: method in its implementation. So, you can override -dragImage:at:offset:event:pasteboard:source:slideBack: , add any additional pasteboard types you need, and then call super's -dragImage:at:offset:event:pasteboard:source:slideBack: to allow everything to continue as before.


[Sep 15, 2003]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.