I want to call the viewDidLoad in my view controller from my appDelegate. How do I do so?

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    TCAViewController *uiTCA = [[TCAViewController alloc] init];

    if(uiTCA.failed == 1){

        //Here I want to call viewDidLoad

// I thought something like this would work but I get an error
// [self uiTCA.viewDidLoad];


    }
}
有帮助吗?

解决方案

You don't call viewDidLoad, the system calls it when all the outlets have been set on the view controller.

Create a method - (void)doSomething; in your TCAViewController class and call that in your AppDelegate.

[uiTVA doSomething];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top