1

Well, I did add the JSONKit classes (JSONKit.h & JSONKit.h) but in the .m file, I have a lot of warnings & compil's error's like:

NSError *error;  //--> ARC forbids Objetive-C in structs or unions

or 

id key, object; whit the same error

anObject = [anObject retain]; //---> ARC forbids explicit message send 'retain''

or many error's in this part code:

static void _JKArrayInsertObjectAtIndex(JKArray *array, id newObject, NSUInteger objectIndex) {
  NSCParameterAssert((array != NULL) && (array->objects != NULL) && (array->count <= array->capacity) && (objectIndex <= array->count) && (newObject != NULL));
  if(!((array != NULL) && (array->objects != NULL) && (objectIndex <= array->count) && (newObject != NULL))) { [newObject autorelease]; return; }
  if((array->count + 1UL) >= array->capacity) {
    id *newObjects = NULL;
    if((newObjects = (id *)realloc(array->objects, sizeof(id) * (array->capacity + 16UL))) == NULL) { [NSException raise:NSMallocException format:@"Unable to resize objects array."]; }
    array->objects = newObjects;
    array->capacity += 16UL;
    memset(&array->objects[array->count], 0, sizeof(id) * (array->capacity - array->count));
  }
  array->count++;
  if((objectIndex + 1UL) < array->count) { memmove(&array->objects[objectIndex + 1UL], &array->objects[objectIndex], sizeof(id) * ((array->count - 1UL) - objectIndex)); array->objects[objectIndex] = NULL; }
  array->objects[objectIndex] = newObject;
}

how can I use in the best way the JSONKit & JSON framework for xcode 4.6 iOS 6?

& thanks a lot!!! greetings from Bolivia!! Rock ON!!! XD

user_Dennis_Mostajo
  • 2,279
  • 4
  • 28
  • 38

2 Answers2

2

Trying to use another fork of JSONKit. With a simple search, I have find some fork which have correct this problem.

Maybe this one: https://github.com/Kelp404/JSONKit/network

The last commit of original JSONKit is up to 8 month at this day... it's bad !

Vincent Saluzzo
  • 1,377
  • 1
  • 11
  • 13
  • thanks Vincent!!, but I did try that too & I still have the same problem, I cannot fixed the error's T_T', I will keep trying and looking the solution Thanks again!!! XD – user_Dennis_Mostajo Mar 07 '13 at 15:04
  • o_O strange, I used JSONKit in all my project and I use XCode 4.6 and iOS6, and all working nicely on my computer ! – Vincent Saluzzo Mar 07 '13 at 15:31
  • & are you using the Automatic Reference Counting ARC? o_O? without problems? y will try use Edit > Refactor > Convert to Objective-C ARC but I dont know why this sintaxis give me an error: "NSError *error;" //--> ARC forbids Objetive-C in structs or unions or " id key, object;" i dont know how fix it T_T'' – user_Dennis_Mostajo Mar 07 '13 at 15:46
  • Yes, I use ARC in my projects – Vincent Saluzzo Mar 07 '13 at 17:12
  • Vincent!!! Dude!! you were right!!, searching the solution I add under TARGETS from my project, & then in BuildPhases I did double-click in JSONKit.m and add the following flag "-fno-objc-arc". like in this answer Question's :[link](http://stackoverflow.com/questions/10681597/does-jsonkit-support-arc-or-is-there-a-fork-that-supports-arc) http://stackoverflow.com/questions/10681597/does-jsonkit-support-arc-or-is-there-a-fork-that-supports-arc & work's Perfectly!! anyway thank you very much!!! for the help – user_Dennis_Mostajo Mar 07 '13 at 19:39
  • AND FOR ALL... well, for the problem that I Looking, just I did add under TARGETS from my project, & then in BuildPhases I did double-click in JSONKit.m and add the following flag "-fno-objc-arc". like in this answer: http://stackoverflow.com/questions/10681597/does-jsonkit-support-arc-or-is-there-a-fork-that-supports-arc, I guess that classes from JSONKit take a long time to update to version 4.X xcode official with ARC, meanwhile we can use this little solution n_n' – user_Dennis_Mostajo Mar 07 '13 at 19:50
1

For anyone interested, I just forked the original repo and added in the fixes (and a Podspec file) that looks like it works with iOS6. https://github.com/JoistApp/JSONKit

mgauthier
  • 321
  • 2
  • 6