3

I am getting compiler errors with libJSONKit and in JSONKit.m. The errors are thrown with this: "Assignment to Objective-C's isa is deprecated in favor of object_setClass()".
There is also a secondary error: "Direct access to Objective-C's isa is deprecated in favor of object_getClass()".

Any advice on workarounds or solutions?

Muddu Patil
  • 713
  • 1
  • 11
  • 24
Michael Lorenzo
  • 628
  • 10
  • 20

2 Answers2

8

Simply follow the advice in the error message:

Change:

object->isa  = SomeClass;

to:

object_setClass(object, SomeClass);
trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • That worked! Could you explain what the syntax of the first version means? And what isa means? This is just to learn more about it. – Michael Lorenzo Mar 20 '14 at 20:34
  • @MichaelLorenzo See the following SO question, which contains a good explanation of `isa`: http://stackoverflow.com/questions/3405224/what-does-isa-mean-in-objective-c – trojanfoe Mar 20 '14 at 20:42
  • 1
    Maybe this works in earlier versions also but in XCode 5.1.1 just tapping the red error bullet and choosing the 'Fix It' recommendation worked like a charm for me. Thanks! – Catherine May 08 '14 at 21:22
0

You might have to remove the 64 bit architecture from your project settings.

This is happening because Apple added arm64 as part of the standard architectures updating to iOS 7.1 and Xcode 5.1. You might have to manually set it to armv7, armv7s... JSONKit does not support arm64 yet.

Lisarien
  • 1,136
  • 1
  • 12
  • 24
  • So now apple requires 64 bit, I must have arm64, but I have the isa issue… how to get around the problem when required to include arm64 ? One of my isa issues was in a file I could edit, the other is in a lib I can't edit it appears…. hrmmm – CthulhuJon Mar 10 '15 at 00:08
  • In this case, the solution usually consists to check for recent update of the library causing the issue. Is this library provide with open source project or is it from a commercial product ? – Lisarien Mar 11 '15 at 06:53