8

In my application, i need to add + & - button to add and delete the row from a table, I tried to find out any default image/ button but didn't get , Proper images for + & - button, Do i need to arrange these buttons image by my own or its available in the Cocoa framework. Thanks again for looking at question, probably silly question doesn't it

Amitg2k12
  • 3,765
  • 10
  • 48
  • 97

1 Answers1

12

There are system-provided images for this, named NSAddTemplate and NSRemoveTemplate. You can enter those names into the image field for your buttons in Interface Builder, or alternatively use these constants to access the images programmatically:

[NSImage imageNamed:NSImageNameAddTemplate];
[NSImage imageNamed:NSImageNameRemoveTemplate];
Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
  • These are only available since Leopard, by the way, so if, for some reason, you're still supporting Tiger or earlier, you'll need to bundle the images into your app and load them by name using `imageNamed:`. Back in the day, I created a plus and minus image pair for exactly this purpose: http://boredzo.org/plusminus/ – Peter Hosey Jul 18 '11 at 11:05
  • Thanks rob & peter, my app will be running on the leopord only – Amitg2k12 Jul 18 '11 at 12:44
  • Tried to find this in early 2018. It's now called `init?(named: NSImage.Name)` in `NSImage`. – Wizard of Kneup Jan 03 '18 at 19:41