1

I am integrating SLService for Twitter into an application. It works great on iPhone but disappears on iPad.

I have integrated on the iPad:

  [actionSheet showFromRect:self.myRect inView:self.tableView animated:YES];

rather than:

 [actionSheet showInView:[UIApplication sharedApplication].keyWindow];

Is there a similar method for the iPad in lieu of presentViewContoller: Animated:?

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController
                                               composeViewControllerForServiceType:SLServiceTypeTwitter];
        [tweetSheet setInitialText:self.textForTweet];

        [self presentViewController:tweetSheet animated:YES completion:nil];
    } else [self displayAlertBoxWithTitle:@"Tweet Failed" message:@"Please try again later" cancelButton:@"Close"];
}

Should I be using a Modal dialog instead?

Silviu St
  • 1,810
  • 3
  • 33
  • 42
PhillipOReilly
  • 609
  • 12
  • 28

1 Answers1

2

I missed this error message at first:

Warning: Attempt to present <SLComposeViewController: 0x175d6560>  on <ScheduleTableViewController: 0x17538c20> which is already presenting (null)

That lead me to discussion of same problem in a different context here.

Resolved the issue by suggested work around:

dispatch_async(dispatch_get_main_queue(), ^ {
            [self presentViewController:tweetSheet animated:YES completion:nil];
        });
Community
  • 1
  • 1
PhillipOReilly
  • 609
  • 12
  • 28