• 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: How to find icon file path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find icon file path?


  • Subject: Re: How to find icon file path?
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 24 Jul 2002 04:23:39 +0200

On Wednesday, July 24, 2002, at 03:59 , Chris Anderson wrote:

I have a file, say, Foo.txt. NSFileManager iconForFile: Foo.txt gives back an NSImage that that a the generic icon for text files in it. However, I can find no method of NSImage (or NSFileManager) that tells the path to the *icon* source from which the NSImage bitmaps were created.
I'm assuming this would look something like /System/Library/Whatever/Text.icns if I could get it.

Nope. It might be that; it might be also a TIFF or perhaps even a part of some blasted old-type rsrc file. In some future OSX release, it even might be generated programmatically from a number of sources.

Just use the NSImage you've got. If you for some reason need to have a file, well, save it.

My application wants to determine whether two files use the same icon or not, and iconForFile: won't tell me that (short of comparing all the bitmap pixels and wasting lots of spacetime, which I'd really rather not have to do.)

Hmmmm. You mean you get different NSImages with the same contents for different files which share the same icon? It is possible, but I would be surprised.

So, the source for NSFileManager iconForFile: clearly has figure out where to get its icon data from...

Sure it has. The thing is, it is quite possible it is not a file, after all. And it might change with each OS release.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
  • Follow-Ups:
    • Re: How to find icon file path?
      • From: Ondra Cada <email@hidden>
References: 
 >Re: How to find icon file path? (From: Chris Anderson <email@hidden>)

  • Prev by Date: Re: Error with most basic method
  • Next by Date: Re: How to find icon file path?
  • Previous by thread: Re: How to find icon file path?
  • Next by thread: Re: How to find icon file path?
  • Index(es):
    • Date
    • Thread