Fix JSONKit Xcode 4.6 warnings
I use JSONKit in some older projects and since the last version of Xcode (4.6 that is) some depreciation warnings always came up.
And I HATE these kind of warnings.
What to do?
You can do 2 things:
- Use the new ‘NSJSONSerialization‘ class available in iOS 5
- Correct the code in JSONKit
Ignore the warnings with some directives
Code correction
Replace the following lines in the JSONKit.m file:
array->isa = _JKArrayClass;
dictionary->isa = _JKDictionaryClass;
by:
object_setClass(array, _JKArrayClass);
object_setClass(dictionary, _JKDictionaryClass);
And done!
Written by Jelle Vandebeeck
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#