I have a view called MyViewController, that I initialize from a xib file.
Its loadView method looks like this:
- (void) loadView
{
[super loadView];
// some initializations
}
I create it from some other view controller like this
-(void) createMyViewController
{
MyViewController *aController = [[MyViewController alloc] initWithNibName: @"MyViewController" bundle: nil ];
self.myController = aController;
[aController release];
CGRect rect = CGRectMake(10, 232, 308, 176);
myController.view.frame = rect;
myController.view.autoresizingMask =
UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:graphController.view];
}
I've noticed, that each time .view notation is called, loadView of MyViewController is called. I set the view property in the xib file, whether File Owner identity is set MyViewController and the view identity is set to MyView. When the view is set it doesn't suppose to call loadView each time.
Please shed some light! I'm fighting this for the whole day already...
Thanks a lot