如何在XCODE 4.2中使GDATAXML与ARC兼容?

Al-*_*ani 6 xcode automatic-ref-counting gdataxml

我尝试使用折射器自动将GDATAXML Lib转换为ARC - >在XCode 4.2中转换为ARC Objective-C.

ARC转换器给出以下错误:

  result = [NSString stringWithUTF8String:(const char *) chars];
  if (cacheDict) {
    // save the string in the document's string cache
    CFDictionarySetValue(cacheDict, chars, result);
  }
Run Code Online (Sandbox Code Playgroud)

错误:暗示将Ojective-C指针转换为void.

有没有人成功将GDATAXML Libs转换为ARC Objective-C?

yon*_*nja 7

请按照有关如何使GDataXML处理代码的说明进行操作:http://ibombsite.blogspot.com/2012/02/how-to-make-gdataxmlnode-work.html

  • 我将为您保存一下 - 选择Build Phases选项卡.展开编译源.选择GDataXMLNode.m,然后按Enter键.在弹出的小输入框中,输入-fno-objc-arc. (2认同)

iDr*_*oid 0

你需要使用桥接转换:

CFDictionarySetValue(cacheDict, chars, (__bridge_retained_void*) result);

查看Apple的文章“Transitioning to ARC”,特别是关于桥接的部分