On 28/06/2009, at 5:36 PM, Marco S Hyman wrote:

I'd like to get the path of the file containing the data used to
create an NSImage when that images is dragged onto an NSImageView.
I think I stated that correctly.  Is it possible?   If so a pointer
to the appropriate doc would be appreciated.

Looking through the doc it seems that an image will retain its
path with -setDataRetained if initialized using – initByReferencingFile:
but even then I see no way to get the path.


That's right - you can't. Once data is in the form of an NSImage its original path isn't available, regardless of whether the image retains the data or not. It's probably in there somewhere but there's no public API (please file a bug requesting one, it would help me also!).

You need to go back a step and intercept the drag at an earlier stage when it's still just a filename or file promise (whatever the Finder sends, I can't remember).

--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