title: Controls disabled after code executed XCode 4.5 iOS 6
body: <p>I've created an app which uses the following:</p>
  
  <p>SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook
  SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter</p>
  
  <p>The code seems to work OK and makes the posts to Facebook and Twitter but then once the posts have been completed and I return back to the app view none of the controls are active and I have to close the app and relaunch for them to work again.</p>
  
  <p>I think I have nested to code incorrectly in the IF statement (posted below), so was wondering if anybody could offer any advice.</p>
  
  <p>I'm very new to Xcode etc so please be patient and kind to me :-)</p>
  
  <p>Thanks in advance</p>
  
  <p>Pete</p>
  
  <pre><code>- (IBAction)postButton:(id)sender
  </code></pre>
  
  <p>{
      if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])</p>
  
  <pre><code>{
      SLComposeViewController *facebook = [[SLComposeViewController alloc] init];
  
      ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]);
  
      {
          SLComposeViewController *twitter = [[SLComposeViewController alloc] init];
  
          facebook = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
          [facebook setInitialText:[[self statusMessage]text]];
  
          twitter = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
          [twitter setInitialText:[[self statusMessage]text]];
  
          [self presentViewController:facebook animated:YES completion:nil];
  
          [facebook setCompletionHandler:^(SLComposeViewControllerResult result)
  
          {
              NSString *output;
              switch (result)
              {
                  case SLComposeViewControllerResultCancelled:
                      output = @"Action Cancelled";
                      break;
                  case SLComposeViewControllerResultDone:
                      output = @"Post Sucessfull";
                  default:
                      break;
              }
  
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Facebook" message:output delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
              [alert show];
  
              [self presentViewController:twitter animated:YES completion:nil];
  
              [twitter setCompletionHandler:^(SLComposeViewControllerResult result)
  
              {
                  NSString *output;
                  switch (result)
  
                  {
                      case SLComposeViewControllerResultCancelled:
                          output = @"Action Cancelled";
                          break;
                      case SLComposeViewControllerResultDone:
                          output = @"Tweet Sucessfull";
                      default:
                          break;
                  }
  
                  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Twitter" message:output delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                  [alert show];
  
              }];
          }
  
           ];}
  }
  </code></pre>
  
  <p>}</p>