0

I'm trying to create an NSImage of the generic lcd icon found in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/public.generic-lcd.icns. Currently, I load this icon using the following code:

NSImage *icon = [[NSImage alloc] initWithContentsOfFile:@"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/public.generic-lcd.icns"];

This clearly isn't a good way to load this image though, because if Apple decides to change the location of the icons this won't work anymore. I can't find a constant that loads the same icon though, like you can do for the computer image:

NSImage *icon = [NSImage imageNamed:NSImageNameComputer];

I found this question about icons, but none of the described methods work for me (apart from the direct URL). So my question is, how can I load the generic lcd image without using the full path?

Community
  • 1
  • 1
Frog
  • 1,631
  • 2
  • 17
  • 26
  • Copy the images into your app bundle. There might be license implications, however, but I doubt Apple would care too much. – trojanfoe Jun 09 '14 at 15:51
  • @trojanfoe: That's clearly one solution, but find a constant that works is better... Is there really no way to do that? – Frog Jun 09 '14 at 15:54
  • Not if there isn't a constant, no. You don't need to use the Apple images; you could probably create your own images without too much work. – trojanfoe Jun 09 '14 at 15:55
  • @trojanfoe: True, but maybe there is a constant and I just haven't been able to find it? – Frog Jun 09 '14 at 15:59
  • I've never seen one; so I don't *think* there is one. – trojanfoe Jun 09 '14 at 16:02

0 Answers0