简体   繁体   English

带有ARC的xcode 4.6 ios 6的JSONKit?

[英]JSONKit for xcode 4.6 ios 6 with ARC?

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: 好吧,我确实添加了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;
}

how can I use in the best way the JSONKit & JSON framework for xcode 4.6 iOS 6? 如何以最佳方式使用xcode 4.6 iOS 6的JSONKit和JSON框架?

& thanks a lot!!! & 非常感谢!!! greetings from Bolivia!! 来自玻利维亚的问候!! Rock ON!!! 摇滚!!! XD XD

Trying to use another fork of JSONKit. 试图使用JSONKit的另一个分支。 With a simple search, I have find some fork which have correct this problem. 通过简单的搜索,我找到了一些正确解决这个问题的fork。

Maybe this one: https://github.com/Kelp404/JSONKit/network 也许这个: https //github.com/Kelp404/JSONKit/network

The last commit of original JSONKit is up to 8 month at this day... it's bad ! 原始JSONKit的最后一次提交在这一天长达8个月......这很糟糕

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM