相关疑难解决方法(0)

TWOSweetComposeViewController在IOS6中已弃用

我的代码按预期工作只是因为我需要摆脱这个警告消息.在IOS6中不推荐使用TWTeetComposeViewController.是否在ios6中替换了这个内置视图控制器?

这是我的示例代码.

if ([TWTweetComposeViewController canSendTweet]) {
    // Initialize Tweet Compose View Controller
    TWTweetComposeViewController *vc = [[TWTweetComposeViewController alloc] init];
    // Settin The Initial Text
    [vc setInitialText:@"This tweet was sent using the new Twitter framework available in iOS 5."];
    // Adding an Image
    UIImage *image = [UIImage imageNamed:@"sample.jpg"];
    [vc addImage:image];
    // Adding a URL
    NSURL *url = [NSURL URLWithString:@"http://mobile.tutsplus.com"];
    [vc addURL:url];
    // Setting a Completing Handler
    [vc setCompletionHandler:^(TWTweetComposeViewControllerResult result) {
        [self dismissModalViewControllerAnimated:YES];
    }];
    // Display Tweet Compose View Controller Modally
    [self presentViewController:vc …
Run Code Online (Sandbox Code Playgroud)

twitter objective-c ios ios6

37
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

ios6 ×1

objective-c ×1

twitter ×1