Giter VIP home page Giter VIP logo

Comments (7)

Gareth-swifter avatar Gareth-swifter commented on June 9, 2024

https://github.com/jcbertin/JSONKit

use it

from jsonkit.

BadSuNian avatar BadSuNian commented on June 9, 2024

I've replaced the still crash tip:

Sep 19 14:18:35 XXXX[718] : CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 19 14:18:35 XXXX[718] : CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 19 14:18:35 XXXX[718] : CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

from jsonkit.

caisd1998 avatar caisd1998 commented on June 9, 2024

@BadSuNian I have same problem. I thought it was because of JSONKit, but I still have crash after applied @h532930330's patch. And then I find out that another third party library TXJSONKitSerializing defines same category method which crashes app.
How I fix: I changed JSONKit's category method name to another to avoid using TXJSONKitSerializing because TXJSONKitSerializing is inside some lib.a so I can't change.
Chinese comment (中文解释)
我根据上面的comment解决后,还是有问题,后来发现,在运行的时候,方法JSONString其实是调用了某个第三方库的TXJSONKitSerializing定义的方法,而不是JSONKit里的。
看样子,在运行时,第三方库的方法覆盖了源码里的同样的方法。
解决办法就是,把JSONKit里的方法加个前缀,然后代码里面使用这个加了前缀的方法,这样就不会误用到TXJSONKitSerializing里的。
这也强调了一个写Category方法的要求,尤其是提供给别人使用的第三方库的时候,一定要加上前缀,以防影响到使用者。

from jsonkit.

poorbird avatar poorbird commented on June 9, 2024

@caisd1998 cool,you are right.
多亏遇到你,找了好几天终于解决了,感谢分享

from jsonkit.

BadSuNian avatar BadSuNian commented on June 9, 2024

@caisd1998 my email [email protected] your? Please explain in detail.

from jsonkit.

loveNoodles avatar loveNoodles commented on June 9, 2024

My project crashed here :

void objectISA = (JK_EXPECT_F(workAroundMacOSXABIBreakingBug)) ? NULL : *((void *)objectPtr);

my codes are like this below:
NSArray * josnArry = [[NSArray alloc] init];
NSString * josnString = [josnArry JSONString];

inside josnArry are NSDictionary(s) ! help !

from jsonkit.

cocoZ avatar cocoZ commented on June 9, 2024

Im used "JSONKit" MAJK ?????????????? whats this?

  • thread #1: tid = 0x41774f, 0x000000010995c315 EverVCiOSClientMAJK_encode_add_atom_to_buffer + 6377, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT) frame #0: 0x000000010995c315 EverVCiOSClientMAJK_encode_add_atom_to_buffer + 6377
    frame #1: 0x000000010995c6ba EverVCiOSClientMAJK_encode_add_atom_to_buffer + 7310 frame #2: 0x000000010995a554 EverVCiOSClient-[MAJKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:] + 990
    frame #3: 0x000000010995cc2e EverVCiOSClient`-[NSArray(MAJSONKitSerializing) JSONString] + 71

from jsonkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.