title: how can I remove a facebook login view controller?
body: <p>I am trying to remove a facebook view controller that I created. Basically, the showFBLoginView method that initializes the view controller is the App Delegate and called within a GameOver layer.</p>
  
  <pre><code>-(void)showFBLoginView {
  
     facebookViewController = [[FacebookViewController alloc] init];
     self.facebookViewController = facebookViewController;
  
     // Set loginUIViewController as root view controller
     [[self window] setRootViewController:facebookViewController];
  
     self.window.backgroundColor = [UIColor whiteColor];
     [self.window makeKeyAndVisible];
  
     [self.facebookViewController activateButton:@"Facebook Connect"];
           .
           .
           .
     }
  </code></pre>
  
  <p>The activateButton method within the facebookViewController.m class:</p>
  
  <pre><code>-(void)activateButton:(NSString*)buttonText {    
  CGSize screenSize = [[CCDirector sharedDirector] winSize];
  
  fbConnectButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  fbConnectButton.frame = CGRectMake(screenSize.width/2 - 50*(screenSize.width/480) , screenSize.height/2, screenSize.width/4, screenSize.height/12);
  [fbConnectButton setTitle:buttonText forState:UIControlStateNormal];
  fbConnectButton.backgroundColor = [UIColor redColor];
  [fbConnectButton setTitleColor:[UIColor brownColor] forState:UIControlStateNormal ];
  
  [fbConnectButton addTarget:self action:@selector(callButtonTouched) forControlEvents:UIControlEventTouchUpInside];
  
  [self.view addSubview:fbConnectButton];
  </code></pre>
  
  <p>}</p>
  
  <p>I tried to remove the faceboookViewController in the following way. This was done within the App Delegate.</p>
  
  <pre><code>  [[self window] removeFromSuperview];
  </code></pre>
  
  <p>But it's not working. What is the right way to remove the view controller?</p>