Set custom class name for storyboard programmatically

I am trying to set a custom storyboard class name programmatically in iOS.

I have a storyboard with a viewcontroller MyFirstViewControllerand set the class name asMyFirstViewController

Now I create another viewcontroller SecondViewControllerthat extendsMyFirstViewController

 SecondViewController *vcsecond = (SecondViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"MyFirstViewController"];
        [self.navigationController pushViewController:vcsecond animated:YES];

When I run this application, the SecondViewController method is viewDidLoadnot called, it calls the MyFirstViewControllerviewDidLoad method .

I get vcsecondas an object MyFirstViewController.

Please help me how to open SecondViewControllerusing MyFirstViewControllerXIB.

I just want to inherit all the functionality MyFirstViewControllerfor SecondViewControlleras well as override some methods here and execute new code in an overridden method with additional functions.

The design of both viewcontrollers is the same, just add some new functionality using the overriding method.

Please refer this

In the screen above, TabSearchForDocViewController is my MyFirstViewController controller.

So my current question is ----------

I have a comic storyboard page for two view controllers. My SecondViewController extends MyFirstViewController. Now I want to open my SecondViewController using the storyboard page. Can I set the class name programmatically?

+4
source share
2 answers

, , MyFirstViewController MyFirstViewController . , vcsecond .

0

instantiateViewControllerWithIdentifier , - .

, "" , , . ( ), . .

0

All Articles