Если кнопки являются единственными подпредставлениями в представлении, вы можете использовать это:
//view is a variable pointing to the view containing the buttons
NSArray *buttons = [[view subviews] copy];
Если в представлении есть другие представления, вам придется отфильтровать их:
//view is a variable pointing to the view containing the buttons
NSMutableArray *buttons = [[NSMutableArray alloc] initWithCapacity:25];
for(NSView *v in [view subviews]) {
if([v isKindOfClass:[NSButton class]]) [buttons addObject:v];
}
Редактировать
...
@interface Botones : NSObject {
IBOutlet id Intents;
IBOutlet id Nivel;
IBOutlet id BoxBot;
NSArray *ArBot;
}
...
Botones.m
...
@implementation Botones
- (void)awakeFromNib {
ArBot = [[BoxBot subviews] copy];
/*or
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:25];
for(NSView *v in [BoxBot subviews]) {
if([v isKindOfClass:[NSButton class]]) [array addObject:v];
}
ArBot = [array copy];
[array release];*/
}
...