Getting a Cocoa App’s Icon

Getting your app’s icon:

NSImage *image = [NSApp applicationIconImage];

Getting another app’s icon — this assumes you have a path to the bundle, which you provide as the iconForFile argument:

NSImage *image = [[NSWorkspace sharedWorkspace] iconForFile:@"path"];

According to this post, an  app’s icon can be “overridden” by pasting an image into the “Get Info” window. In this case, the suggested solution is:

NSString *appPath = [[NSBundle mainBundle] bundlePath];
NSImage  *image   = [[NSWorkspace sharedWorkspace] iconForFile:appPath];