2

iOS5. I'm trying to create and add a new container view controller to my app - but need the parent view controller to itself be a child of the another view controller. Is this possible?

What I've tried so far results in the child and/or parent not being visible.

While I'm asking - has anyone got any good reference examples of creating container view controllers in iOS5. Btw, I've watched Apple's WWDC video.

ader
  • 5,403
  • 1
  • 21
  • 26

1 Answers1

0

Ok, well to answer my own question again, lol, No a Container ViewController doesn't have to be a root view controller.

My app structure is a navigation controller (let's call this vc1) with a variety of viewcontrollers pushed and popped on/off. One of these pushed view controllers (lets call it vc2) needs to have child view controllers. Originally I wanted to create a Container View Controller (let's call it vc3) and add this as a child of the pushed view controller and then add children to it (let's call this vc4 and vc5). This would have resulted in the following:

Nav Controller (vc1) View Controller (vc2) Container View Controller (vc3) View Controller (vc4) View Controller (vc5)

I couldn't get this working. So I had a rethink and tried combining vc2 and vc3. This seems to be working so far (I have got a visible view controller view).

My (so far) working structure is:

Nav Controller (vc1) Container View Controller (vc2) View Controller (vc3) View Controller (vc4)

ader
  • 5,403
  • 1
  • 21
  • 26