1

like this image below

i have used container view on the right side and i used another view controller as a child view controller to this container view. i want to change the data appearing in that container view. FYI i m loading the EKEventViewController in that container view. So obviously the tableview contains the events from the calendar. I've seen many tutorials but i m unable to change the content in the container view. Any help is appreciated.

here is some of the code i used.

in contentVC since i use tableview, i wrote the code in didSelectRowAtIndexPath: method

[self.view addSubView:containerView]; [self addChildController:eventViewController]; //which is the childcontroller of containerview

and in eventViewController class viewDidLoad: method

i assigned EKEventViewController Object as a childcontroller of the container view object since i want the UI of EKEventViewController in the containerview.

Simply EKEventViewController (Childcontroller of) eventViewController (childcontroller of) ContainerView. Any help is appreciated

sreekanthk
  • 362
  • 2
  • 21
  • **fully and totally explained here** with diagrams ... just scroll down to the "Identifier..." section: http://stackoverflow.com/questions/23399061/objective-c-how-to-add-a-subview-that-has-its-own-uiviewcontroller/23403979#23403979 – Fattie Jun 24 '16 at 12:47

2 Answers2

1

problem solved guys. thanks for the responce @JoeBlow, just a silly thing i forgot after a lot of research. i'm not using the segues

How to add a subview that has its own UIViewController in Objective-C?

Community
  • 1
  • 1
-1

Your

viewDidLoad:

method is not the one to call. You should be adapting the:

viewWillAppear:

method instead.

The viewWillAppear occurs after the viewDidLoad is already finished. Try adding the correct view there.

Brooks Hanes
  • 425
  • 2
  • 12
  • i tried that too but no use, i want some example code how to get those two viewcontrollers combined in a container view. if u have any send me. – user3664338 Sep 18 '14 at 05:33
  • A downvote? Hmmm... I am suggesting you examine the entire mechanism for which you're loading the views, since the views are the problem. Perhaps you need to post the entire method in order to get more assistance. Posting some code for you may be a bit presumptuous since I cannot see what you already have. I'd love to post some more code, but would like to see your foundation first. – Brooks Hanes Sep 22 '14 at 19:59
  • 1
    Just FYI the QA here relates to container views and **segues** (view loading/appear is unrelated) – Fattie Jun 24 '16 at 12:49