从appDelegate调用viewdidload

时间:2014-01-23 20:44:43

标签: ios ios7 appdelegate viewdidload

我想从我的appDelegate调用我的视图控制器中的viewDidLoad。我该怎么做?

- (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];


    }
}

1 个答案:

答案 0 :(得分:0)

您没有拨打viewDidLoad,系统会在视图控制器上设置所有插座后调用它。

- (void)doSomething;课程中创建方法TCAViewController,并在AppDelegate中调用该方法。

[uiTVA doSomething];