Question

I have a ViewController where I have placed another ViewController on one of it's SubView. In that ViewController (placed in SubView) I need to go to another ViewController on a click event. But when I can self.navigationController pushViewController method , My log says It's pushed but Screen is not changing.

My attached image depicts the scene , Match Details is the host ViewController. White rectangle is a UIView , and the guest ViewController is placed within this white rectangular View. When I click on the round button (Click written) , then another ViewController should replace the Host ViewController.

It's a complex application , so pasting codes here should not be a good idea. Just a few explanation would help me a lot , I can fix the codes myself. Some some hint required about my mistake.

enter image description here

Thanks in advance for help.

Était-ce utile?

La solution

When you add view of viewController as subview you need also register your viewController as child view controller for parentViewController.

Example:

UIViewController *mainVC = [UIViewController new];
UIViewController *childVC = [UIViewController new];

[mainVC addChildViewController:childVC];
[mainVC.view addSubview:childVC.view];

UIViewController *parentVC = childVC.parentViewController;

Here parentVC is mainVC.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top