문제

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