New update: I created a completely new project, which is built exactly the same as shown below. However, this test project actually works fine, even if it looks like the same ... One thing I noticed is that the parent view controller in the broken version receives -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event when you click on the view controller's child view ... In the working version, the child view controller receives the event as it should ... Is it like the parent view is blocking the child view or something else.?
Update progress: screwing in a bit, I found that it works great when directly assigning a frame to the controllers of the child elements. However, I have to create my project using autorun, so this is what I did. For some reason, auto-detection causes a user to overlook the childhood viewer ...
Currently I have a viewcontroller that has only 1 childviewcontroller. The view of the childviewcontroller is displayed just fine, but I generally cannot interact with the childViewController. ChildViewController has several UIButtons, but they do not respond to clicks.
I tried to test this in both parent and child controllers.
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"Touched!"); }
When you click on a view frame of a child view controller, this method responds in the parent view controller, but not in the child view controller.
The child view controller also works correctly when you create it directly and set it up as the root view controller in the application delegate.
The code I use in the parent view controller is:
(void) viewDidLoad { [super viewDidLoad]; self.detailPageVC = [[GoalDetailsPageViewController alloc] init]; [self.view addSubview:self.detailPageVC.view]; [self addChildViewController:self.detailPageVC]; [self.detailPageVC didMoveToParentViewController:self]; }
Thanks for helping the newbie! :)