Using container view as a Dashboard

柔情痞子 提交于 2019-12-06 12:35:38

问题


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


回答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?




回答2:


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.



来源:https://stackoverflow.com/questions/25664299/using-container-view-as-a-dashboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!