Open JetForMe opened 5 years ago
Interestingly, doing the same thing with regular methods works fine. I wonder if this is an ARC bug.
Have you found the solution, sir?
Wow, sorry, I can't even remember why I wrote this code.
I wrote this code was for testing in my script. I just found the invocation won't be released if I used a property to hold it. So it is not a problem now. Thanks anyway.
I attempted to swizzle the class method
JSONObjectWithData:options:error:
like this:But unfortunately this doesn't seem to work, as the returned dictionary gets released before a later call to
objc_retainAutoreleasedReturnValue()
deep inside iOS, causing a crash. Enabling Zombie objects shows: