I have a lot of trouble doing something very simple. I have a viewController and a subViewController, as with views loaded from nib. For clarification, the parent view is 1024 by 748, and the subView is 640 by 480 in tips.
In the viewControllerDidLoad view, I add a subViewController view as follows:
[self.view addSubview:self.subViewController.view]; NSLog(@"subview.frame:%@",NSStringFromCGRect(self.subViewController.view.frame));
Log outputs:
subview.frame:{{0, 0}, {640, 480}}
Then, to check everything, I use setCenter to try to move the subview in the parent view in the same position as in the following:
CGPoint newCenter = CGPointMake(0,0);
Log outputs:
after changing center. subview.frame:{{-320, -240}, {640, 480}}
Now I have a feeling that something can be plunged into the umbilical cord, and I guess that it has something to do with the springs and spacers / sizes and positions. I can only guess about it because this function has the least understanding of when it comes to IB.
Any other ideas as to what might cause this problem? Do you have any general advice on how to configure viewcontrollers in IB to automatically position themselves in accordance with other viewcontrollers? And after setting up, is SetCenter installed the correct way to dynamically move them?