I'm totally lost with superview, loadView(), viewDidLoad(), viewWillAppear().
Eventually, I want to set my controller's frame to superview's bounds and utilize [self.view bounds] at my viewDidLoad(). (maybe this is impossible?)
here's the code snippet that gives me grief..
// add the controller's view to the scroll view
if (nil == controller.view.superview) {
CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * page;
frame.origin.y = 0;
controller.view.frame = frame;
[scrollView addSubview:controller.view];
// I'd like to set controller.view 's frame using superview(scrollView here).
}
Apparently, nil == controller.view.superview calls the controller's viewDidLoad.
I used to access [self.view bounds] and use it inside my viewDidLoad
Since I want to set view's frame after adding it to superview, I guess I need to move the codes that utilizes [self.view bounds] to somewhere else.
What is the good place to move to?
Or Is there better approach?