带有ARC的xcode 4.6 ios 6的JSONKit?

时间:2013-03-07 14:52:14

标签: automatic-ref-counting xcode4.6 touchxml jsonkit json-framework

好吧,我确实添加了JSONKit类(JSONKit.h和JSONKit.h)但是在.m文件中,我有很多警告& compil的错误就像:

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;
}

我怎样才能以最好的方式使用JSONKit&amp;适用于xcode 4.6 iOS 6的JSON框架?

&安培;非常感谢!!!来自玻利维亚的问候!!摇滚!!! XD

2 个答案:

答案 0 :(得分:2)

尝试使用JSONKit的另一个分支。通过简单的搜索,我找到了一些解决这个问题的分叉。

也许这一个: https://github.com/Kelp404/JSONKit/network

original JSONKit的最后一次提交截止日期为8个月......这是糟糕

答案 1 :(得分:1)

对于任何感兴趣的人,我只是分叉原始的repo并添加了修复程序(和一个Podspec文件),看起来它适用于iOS6。 https://github.com/JoistApp/JSONKit

相关问题