• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSImageView/NSImage question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView/NSImage question


  • Subject: Re: NSImageView/NSImage question
  • From: Graham Cox <email@hidden>
  • Date: Mon, 29 Jun 2009 15:12:51 +1000


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@hidden)

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:
This email sent to email@hidden


References: 
 >Re: I want my app to crash! (From: Andreas Grosam <email@hidden>)
 >Re: I want my app to crash! (From: M Pulis <email@hidden>)
 >Re: I want my app to crash! (From: Andy Lee <email@hidden>)
 >NSImageView/NSImage question (From: Marco S Hyman <email@hidden>)

  • Prev by Date: Re: Intersection of CGPath and CGRect
  • Next by Date: Re: NSCell subclassing nightmares
  • Previous by thread: NSImageView/NSImage question
  • Next by thread: Group CGAffineTransform Animations?
  • Index(es):
    • Date
    • Thread