我在ViewController.m中写得很好,但是当我在MyScene类中编写它时,我得到错误:'MyScene'没有可见的@interface声明选择器'presentViewController:animated:completion:'
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"text"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)