用Xcode自带的分享功能分享到新浪微博

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

        if (![SLComposeViewController isAvailableForServiceType:SLServiceTypeSinaWeibo])
        {
            UIAlertView* alert=[[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"亲,你还没有登录哦" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles: nil];
            [alert show];
        }
        SLComposeViewController *cvv = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeSinaWeibo];
        [cvv setInitialText:@"妖精的尾巴分享了图片,你也来看看吧,说不定有惊喜哦。"];
        NSURL* url=[NSURL URLWithString:@"http://my.oschina.net/iOSliuhui/blog"];
        [cvv addURL:url];
        [self presentViewController:cvv animated:YES completion:nil];
        cvv.completionHandler = ^(SLComposeViewControllerResult result){
            if (result == SLComposeViewControllerResultCancelled) {
                NSLog(@"取消发送");
            } else {
                NSLog(@"发送完毕");
            }
        };