Search code examples
cocoauser-interfacetoolbarosx-mountain-lionnsbundle

10.8 standard share icon - where to get it?


I would like to add a "share" button in my Mac app, like Safari and other apps have in OS X 10.8.

Is it possible to get this icon programmatically from another bundle on runtime? Or should I make a copy of it and include it in my app bundle?


Solution

  • [NSImage imageNamed:NSImageNameShareTemplate] will give you an NSImage with the default share image. You don't need to include a copy of the image since it is a system resource (at least, in 10.8. It is a different story if it is 10.7). There is a list of other system provided icons here.

    You may also want to look up NSSharingServicePicker if you will be implementing a standard share menu.