27

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?

Eksperiment626
  • 985
  • 3
  • 16
  • 30

2 Answers2

64

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.

Community
  • 1
  • 1
DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • 2
    Thank you SO MUCH. You really made my day :D... I was stuck in learning to program to the iPhone but now I can continue :D – Eksperiment626 Jul 14 '11 at 11:21
  • 4
    The search probably won't work as expected. The flag is called CLANG_ENABLE_OBJC_ARC in user defined section. Or remember to uncheck "Automatic Reference Counting" when creating new projects. – h--n Dec 16 '11 at 11:10
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!!

Hardik Thakkar
  • 394
  • 5
  • 17