NSData *imgData = UIImageJPEGRepresentation(image, .3); QQApiImageObject *imgObj = [QQApiImageObject objectWithData:imgData previewImageData:imgData title:@"来自火星的分享图片" description:@"just do IT"]; uint64_t cflag = 1; [imgObj setCflag:cflag]; SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:imgObj]; //将内容分享到qqZone [QQApiInterface SendReqToQZone:req];
qq分享和qq空间的分享有些差别,在腾讯的demo里《http://wiki.connect.qq.com/ios_sandbox1#6..E5.A4.84.E7.90.86QQ.E4.B8.9A.E5.8A.A1.E7.9A.84.E5.9B.9E.E8.B0.83》有一点错误,就是少了
uint64_t cflag = 1; [imgObj setCflag:cflag];
如果不设置这一部分,分享的内容会被分享到qq里,而不是qq空间。
这里是腾讯的sdk。