iOS只分享到微博的解决方法

很简单,利用iOS6的UIActivityViewController

- (IBAction)btn:(id)sender {

    NSArray *activityItems = [[NSArray alloc]initWithObjects:@"分享内容",@"http://www.oschina.net/",[UIImage imageNamed:@"love.png"], nil];
    
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
    activityViewController.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypeMessage,
                                                     UIActivityTypeSaveToCameraRoll, UIActivityTypePrint, 
                                                     UIActivityTypeCopyToPasteboard];
    
    [self presentViewController:activityViewController animated:YES completion:NULL];
    
}







你可能感兴趣的:(iOS只分享到微博的解决方法)