Finding how to use NSArray as an output for a button bundle

My user interface has four buttons, and they will all have common behavior, such as creating a tracking area. What I'm looking for is a solution, so I don't need to do this:

@interface MyController : NSWindowController { NSButton * button1; NSButton * button2; NSButton * button3; NSButton * button4; } @property (nonatomic) IBOutlet NSButton * button1; @property (nonatomic) IBOutlet NSButton * button2; // and so on @end 

I would like to have a solution like this:

 @interface MyController : NSWindowController { NSMutableArray * buttons; } @property (nonatomic) IBOutlet NSMutableArray * buttons; // tell interface builder to place all buttons here @end 

Is it possible?

+6
objective-c cocoa macos
source share
1 answer

Added iOS 4.0 IBOutletCollection , which allows you to connect a power outlet to multiple objects in Interface Builder. However, Mac OS X does not support the release of collections.

If you want to voice support for adding it to Mac OS X, write a promotion request at http://bugreporter.apple.com .

+11
source share

All Articles