My user interface has four buttons and they all will share some common behaviour, like tracking area creation a things like that. What I'm looking for is a solution so I don't have 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 one:
@interface MyController : NSWindowController {
NSMutableArray * buttons;
}
@property (nonatomic) IBOutlet NSMutableArray * buttons;
// tell interface builder to place all buttons here
@end
Is this possible?
iOS 4.0 added IBOutletCollection
, which allows an outlet to be connected to multiple objects in Interface Builder. However, Mac OS X does not support outlet collections.
If you'd like to voice support for adding it to Mac OS X, please file an enhancement request at http://bugreporter.apple.com.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With