Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS How to hide a prior subview
    text
    copied!<p>I have a situation where I am performing some initialization in an App. Upon first startup I have to present an EULA with an I Agree/I Don't Agree button selection. When the I Agree selection is made I display a modal view which prompts for a username and password. This all works fine. The problem is that after the username and password are verified and the modal view is dismissed. I am left with the EULA view still being displayed on the screen rather than the base table view of the App. I do the following in the EULA viewcontroller code:</p> <pre><code>- (IBAction)didAgree:(id)sender { LoginViewController *lvc=[[[LoginViewController alloc] init] autorelease]; lvc.modalTransitionStyle=UIModalTransitionStyleCoverVertical; [self presentModalViewController:lvc animated:YES]; [self.view removeFromSuperview]; } </code></pre> <p>If I move the last line (removeFromSuperview) to before the presentModal call then, of course, the Login view does not display.</p> <p>In the login view controller code I have this after the login button is pressed:</p> <pre><code>[[self parentViewController] dismissModalViewControllerAnimated:YES]; [[self parentViewController].view removeFromSuperview]; </code></pre> <p>If I run with this code, the modal view disappears and the table view appears briefly before disappearing with the EULA view remaining on the screen. If I comment out the second statement, then I never see the table view.</p> <p>I know this I am missing something incredibly obvious but I am at a loss and have been stuck on this for quite a while.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload