forum

Home / DeveloperSection / Forums / Problem in adding subview in UIWindow

Problem in adding subview in UIWindow

Anonymous User 1286 20-Nov-2015

I have created an @property of UILabel and an outlet of UIViewController,
this is the code which works perfectly:

[window addSubview:viewController.view];
[viewController.label setText:@"Label1"];

but when we write this code in reverse order, it generates error:

[viewController.label setText:@"Label1"];
[window addSubview:viewController.view];

why it generate error?


Updated on 20-Nov-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By