After upgrading the Xcode7.2.1, when the app is loaded, it collapses, looks carefully, and discovers that it is in the registration of the microblog SDK when the error:
[Weibosdk Registerapp:wbappkey];
Looked up a lot of information and finally found out in GitHub's Weibo SDK issue discussion area that someone had solved it.
Workaround:
Before registering for the Weibo SDK
1[Nsdictionary aspect_hookselector:nsselectorfromstring (@"weibosdk_wbsdkjsonstring")2 Withoptions:aspectpositioninstead3usingblock:^ (ID<AspectInfo>info)4 {5 return[(nsdictionary*) [Info instance] tt_jsonstring];6 }7Error:nil];
Tt_jsonstring is the category from a dictionary to a string;
Aspect can be installed by pod;
It has been explained that guessing WEIBOSDK used the old version of Jsonkit. Causes the parsing compatibility of JSON out of the question directly upgrading the Weibo SDK is also possible.
Here's a way to turn a dictionary into a string:
1 /* */23 -(nsstring*) Dictionarytojson: (Nsdictionary *) dic{4 5 Nserror *parseerror = nil; 6 7 NSData *jsondata = [nsjsonserialization datawithjsonobject:dic options:nsjsonwritingprettyprinted error:& ParseError]; return [[NSString alloc] Initwithdata:jsondata encoding:nsutf8stringencoding]; 8 9 }
Aspects GitHub Link: https://github.com/steipete/Aspects
Reference Link: https://github.com/sinaweibosdk/weibo_ios_sdk/issues/133
IOS9 those pits--weibosdk Registerapp start on the crash