在升级Xcode7.2.1后,在App加载时直接崩掉,仔细看了,发现是在在注册微博SDK的时候报错:

[WeiboSDK registerApp:WBAPPKey];

查了很多资料,最后在github的微博SDk issue讨论区中发现有人已经解决了。

解决方法:

在注册 微博 sdk 之前

 [NSDictionary aspect_hookSelector:NSSelectorFromString(@"weibosdk_WBSDKJSONString")
withOptions:AspectPositionInstead
usingBlock:^(id<AspectInfo> info)
{
return [(NSDictionary*)[info instance] tt_jsonString];
}
error:nil];
tt_jsonString 是自一个字典转字符串的 category;

 aspect 可以 pod 安装;

有人解释说,猜测weibosdk使用了旧版本的jsonkit.导致了json的解析兼容性出了问题直接升级微博SDK也可以。

这里提供一个字典转字符串的方法吧:

 /** 字典转字符串 */

 - (NSString*)dictionaryToJson:(NSDictionary *)dic{

     NSError *parseError = nil;

     NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

 }

Aspects的github链接:https://github.com/steipete/Aspects

参考链接: https://github.com/sinaweibosdk/weibo_ios_sdk/issues/133

最新文章

  1. 详解C#委托,事件与回调函数
  2. Maven+Spring+MVC结构中,jetty/tomcat是如何启动项目的[转]
  3. 高仿猫眼电影选座(选票)模块-b
  4. URL是否有效
  5. Beyond REST: How to build a HATEOAS API in Java with Spring MVC, Jersey (JAX-RS) and VRaptor
  6. Linux环境 Mysql新建用户和数据库并授权
  7. Case of the Zeros and Ones
  8. Hook SSDT中NtCreateProcessEx
  9. nodejs 后台服务启动
  10. 2017最新PHP初级经典面试题目汇总(下篇)
  11. js基础:对DOM进行操作,删除、添加元素
  12. 【bzoj 4833】[Lydsy1704月赛]最小公倍佩尔数
  13. [四] java虚拟机JVM编译器编译代码简介 字节码指令实例 代码到底编译成了什么形式
  14. Freemaker Replace函数的正则表达式运用
  15. Linux背背背(6)
  16. ASP.NET MVC + EF 更新的几种方式
  17. django中的时区设置TIME_ZONE,USE_TZ
  18. Java枚举的小用法
  19. &lt;Android 基础(二十二)&gt; EditText 无法显示完全以及尝鲜Android N
  20. Web | 一小时看懂前端基本语法

热门文章

  1. 跟我学机器视觉-HALCON学习例程中文详解-QQ摄像头读取条码
  2. 提升WI-FI信号强度的10大方法
  3. 关于npoi不能导入07以上版本的Excel
  4. domReady source code, domready源码
  5. 整合maven,jetty,jrebel进行debug调试
  6. HDU 3392 Pie(DP)
  7. 【转】sublime text 2 下的Markdown写作
  8. PC-经典之“运行里面的密密”
  9. nginx 去掉index.php
  10. DataTable 导出到 Excel 类