• 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
How are we supposed to retrieve the generic bundle icon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How are we supposed to retrieve the generic bundle icon?


  • Subject: How are we supposed to retrieve the generic bundle icon?
  • From: Iceberg-Dev <email@hidden>
  • Date: Tue, 11 Nov 2008 17:36:24 +0100

I need to get a NSImage of the generic bundle icon. (Mac OS X 10.4 or later)

I'm currently using this:

[[NSImage alloc] initWithContentsOfFile:@"/System/Library/ CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns"]

because:

- NSFileTypeForHFSTypeCode('BNDL') does not work. It returns a generic document icon.

- I haven't found an appropriate constant for NSFileTypeForHFSTypeCode.

- I can't rely on -[NSWorkspace iconForFileType:@".bundle"] because, for instance, as soon as Microsoft Word is installed, icons for .bundle can display a Word bundle icon instead of the correct one.

- I haven't found so far a better solution while googling for one.

Question:

Is there a better way to retrieve the generic bundle icon?


_______________________________________________

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


  • Follow-Ups:
    • RE : How are we supposed to retrieve the generic bundle icon?
      • From: Etienne Guérard <email@hidden>
  • Prev by Date: Re: Any way to detect firstResponder changes?
  • Next by Date: Re: Play/Pause, rew/ff keys ...
  • Previous by thread: System Preferences Pane: CGWindowContextCreate error
  • Next by thread: RE : How are we supposed to retrieve the generic bundle icon?
  • Index(es):
    • Date
    • Thread