물론 가능합니다. 하위 뷰를 추가 :
UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; // or UIButton, UIScrollView, or any other view-based class you make think of
[self addSubview:subview];
등
아니면 이런 식으로 뭔가 될 것 버튼에 대한 더 정확하게하기 :
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
aButton.frame = CGRectMake(0, 0, 100, 100);
[aButton addTarget:self action:@selector(methodName) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:aButton]; // if done from the view self.view if done from the controller
아, 죄송합니다 그냥, OSX 아니었다 발견 iOS이지만 기본 사항은 동일합니다. 대신 NSButton 클래스를 살펴보십시오.
NSButton *aButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; // x, y, width, height
시작해야합니다.