10.13.49.png

这一段时间来,我一直有使用PhoneGap来做一些iOS和Android平台的Web APP,每次PhoneGap更新我就会下载过来试一试。有一天,它更新到了1.5版本,居然改了名叫Cordova…

如果按照默认的工程建立,Xcode会告诉你出错了,类似:

'NSAutoreleasePool' is unavailable: not available in automatic reference counting
ARC forbids explicit message send of 'release'

上网搜了一下,发现是因为新版Xcode默认设置了automatic reference counting,而Cordova在生成代码的时候并没有用到这玩意儿,解决方案就是禁用之。

如上方的图片所示,打开工程后选择工程,主容器会显示出工程的配置,选择Build Settings,下方的页签中选择All以及Combined,搜出”Apple LLVM Compiler 3.1 – Language”,在这一组的设置中,有一个叫”Objective-C Automatic Reference Counting”的家伙,把它的值改为”No”。

保存一下,大功告成!

参考网址:http://www.hoitikwong.com/