Why can't I release an object anymore? [duplicate]

╄→гoц情女王★ 提交于 2019-11-26 15:48:19

问题


After I updated to Xcode 4.2, I can no longer release anything. When I start typing "release" it suggest "release" but with a red line across.

If I write it anyway it shows an error and displays these two messages:

'release' is unavailable: not available in automatic reference counting mode Automatic Reference Counting forbids explicit message send of 'release'

Does anyone know what I can do?


回答1:


You need to turn off Automatic Reference Counting. You do this by clicking on your project in the navigator (the top item in the finder-like thing on the left), then click on your target, select "Build Settings" and turn off the option "Objective-C Automatic Reference Counting" (you can use the search field on the upper right to search it).

Another possibility is to migrate your project to ARC.




回答2:


Thanks... its CLANG_ENABLE_OBJC_ARC .. you need to make it NO available under Build Setting. Actually I got this error after updating to Cordova from Phonegap. I hope I wont get into more troubles by doing so.. Cheers.. Happy Coding!!



来源:https://stackoverflow.com/questions/6692022/why-cant-i-release-an-object-anymore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!