嗯,我沒有添加JSONKit類(JSONKit.h & JSONKit.h),但在.m文件,我有很多的警告& compil的錯誤的,如:用於xcode 4.6的JSONKit ios 6與ARC?
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的最佳方式&用於xcode 4.6 iOS 6的JSON框架?
&非常感謝!來自玻利維亞的問候!搖滾樂! XD
感謝文森特!!,但我也嘗試過&我仍然有同樣的問題,我無法修復錯誤的T_T',我會繼續嘗試並尋找解決方案再次感謝! XD – 2013-03-07 15:04:46
o_O奇怪,我在我的所有項目中都使用了JSONKit,並且使用XCode 4.6和iOS6,並且所有工作都很好地運行在我的電腦上! – 2013-03-07 15:31:12
&你在使用自動參考計數ARC嗎? O_O?沒有什麼問題?你會嘗試使用編輯>重構>轉換爲Objective-C ARC,但我不知道爲什麼這個sintaxis給我一個錯誤:「NSError *錯誤;」 // - > ARC禁止在結構或聯合中使用Objetive-C或「id key,object;」我不知道如何修復它T_T'' – 2013-03-07 15:46:03