Jsonkit problems in the 64-bit iOS9 ARM7

Source: Internet
Author: User

Recently encountered a question about Jsonkit, after the project added ARM7 64, Jsonkit will appear [params jsonstring] forkey:@ "Gson"]; Error cases, such as

The specific reason is not very clear, this is the new problem that iOS9 appears, it seems that the dictionary has a problem when it becomes a string. The following solutions are directly attached:

  1. Locate the JSONKit.h file, locate the @interface nsdictionary (jsonkitserializing) in the JSONKit.h file, and add a xmjsonstring method to it, such as

  2. Locate the jsonkit.m file, implement the method you just added in the jsonkit.m file, and implement the

    Attach the implementation code:

    - (NSString *) XMJSOnstring{Nserror *error =NilNSData *jsondata = [Nsjsonserialization Datawithjsonobject:Self options:Nsjsonwritingprettyprinted error:&error];if ([jsondata length] && error = = nil) { NSString *jsonstring = [[nsstring alloc] initwithdata:jsondata encoding: nsutf8stringencoding]; nsstring *replacestring = [jsonstring stringbyreplacingoccurrencesofstring: @ "\ n" withstring:@ ""]; nsstring *treplacestring = [replacestring stringbyreplacingoccurrencesofstring:@" \ \ "Withstring:@" "]; return [treplacestring stringbyreplacingoccurrencesofstring:@ "" Withstring:@ ""]; }else{return nil;}     

PS: If you do not know how to add a method, you can go to the cloud disk to download the rewritten jsonkit. h and. m files, and then directly replace the two files on the line. Here is the cloud Disk link: http://pan.baidu.com/s/1gd59ed9 Password: S5eh
Note that after the file is replaced, Jsonkit may have 19 errors on the arc, find the Targets-build phases in the project, add the settings like

Finally, don't forget to use the method here instead of the method you just added (-(NSString *) xmjsonstring) Oh. The format is:

[request addPostValue:[params XMJSONString]];if (type.length != 0) {}

Jsonkit problems in the 64-bit iOS9 ARM7

Related Article

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.