-(void)shareWeiBo{
NSString* testString=@"#test# ";
WBImageObject *image = [WBImageObject object];
image.imageData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"weiboshare" ofType:@"png"]];
[WBHttpRequest requestForShareAStatus:testString contatinsAPicture:image orPictureUrl:nil withAccessToken:self.wbtoken andOtherProperties:nil queue:nil withCompletionHandler:^(WBHttpRequest *httpRequest, id result, NSError *error) {
CCSafeNotificationCenter::sharedNotificationCenter()->postNotification(MSG_WBFeedDialogResult);
}];
}

本文介绍了一种使用Objective-C实现的在微博中分享包含图片和文本的方法。通过创建WBImageObject对象并设置其图片数据,然后请求分享状态,最终完成在微博上的内容发布。
2万+

被折叠的 条评论
为什么被折叠?



