sinaweibosdk / weibo_ios_sdk

新浪微博 IOS SDK
http://weibo.com
Other
1.45k stars 565 forks source link

最新版的微博分享(文字+图片)报错 #345

Closed Monkshae closed 5 years ago

Monkshae commented 6 years ago

安装了微博或者未安装微博,分享 图片+ 文字 都报一个错误 2017-12-11 10:45:18.544 xxxxxxxx Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' setObjectForKey: object cannot be nil (key: img)' *** First throw call stack: (0x1857fcf48 0x19a3aff80 0x1856e84e0 0x101186880 0x101186248 0x10117ffe0 0x101186168 0x18ad90098 0x18ad8fc9c 0x18b12d108 0x18b0ea844 0x18b0e7254 0x18b04056c 0x18b04d4bc 0x18ad81984 0x1857b3bd0 0x1857b1974 0x1857b1da4 0x1856e0ca0 0x19091c088 0x18adf8ffc 0x100604484 0x19abfe8b8) libc++abi.dylib: terminating with uncaught exception of type NSException

[imageObject addImages:@[,thumbImage]] 经过查证 发现是微博的这个方法除了问题。当我采用 imageObject.imageData = UIImageJPEGRepresentation(thumbImage, 1); 就不会出问题

istupid commented 6 years ago

公司需要增加微博分享,Demo运行,开启图片+文字,就crash。看来微博的SDK没人维护了

yangfangkuo commented 5 years ago

遇到同样问题,安装了客户端可以分享 ,不安装就崩溃 ,看错误相同

shushu2013 commented 5 years ago

判断一下有没有安装客户端,网页登陆不能带图片分享

if ([WeiboSDK isWeiboAppInstalled]) {
       //加图片
}