IOS9 those pits--weibosdk Registerapp start on the crash

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.