I'm loading a nib (XIB) correctly from within a view controller with the following code:
self.myView.view = (MyView *)[[[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self.myView options:nil] objectAtIndex:0];
Now, later on in my flow I have another UIView
that gets displayed. However, I ONLY want this view to be displayed once a certain condition exists AND myView.view
has been removed from the开发者_开发知识库 current self.view
.
What is the correct way to remove a subview that has been added to the main view as I've done above? I can add my header and main of MyView
if needed, but mainly just curious about the correct approach in general.
Thanks for the help in advance! This is bugging me terribly!
[self.myView.view removeFromSuperview];
精彩评论