storyboard instantiateViewControllerWithIdentifier not setting IBOutlets

前端 未结 6 1737
名媛妹妹
名媛妹妹 2020-12-08 19:22

I am using storyboard instantiateViewControllerWithIdentifier: and I\'m noticing that all the IBOutlets I have wired up are still nil. However, the

6条回答
  •  忘掉有多难
    2020-12-08 19:56

    The view seems to be initialized properly only after it is accessed first. The problem goes away when calling

    [self presentViewController:vc animated:NO completion:nil];
    

    or more simply

    [vc view];
    

提交回复
热议问题