Вопрос

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