Why can't i just set self.mySubView = anoterhView; like one can set self.view = anotherView; ?
## .h
@interface TestController : UIViewController {
IBOutlet UIView *mySubView;
}
@property (nonatomic, retain) IBOutlet UIView *mySubView;
##.m
@implements TestController
@synthesize mySubView;
- (void)viewDidLoad {
AnotherController *anotherController = [[AnotherController alloc] initWithNibName:nil bundle:nil];
anotherView = anotherController.view;
// if i do
self.view = anotherView;
// result: replaces whole view with anotherView
// if i instead do
self.mySubView = anotherView;
// result: no change at all
// or if i instead do:
[self.mySubView addSubview:anotherView];
// result: mySubView is now displaying anotherView
}
NOTE: I'm using interfacebuilder. I'm sure everything is hooked up allright because self.view, and self.mySubView addSubview: is working allright..