1

I developing iPhone application for iOS 4.2 using latest SDK iOS5. I trying to add external classes Kal

but i gives me error "ARC forbids explicit message send of 'autorelease', 'retain', and 'release'". And i want to add this classes in my application in any how condition. I want to execute that classes in my application. I stuck on two points basically, 1) How i use explicit use of retain, release, and autorelease keywords 2) How i deploy my app on 4.0 lower version from latest iOS 5.0(Containing ARC scheme)

Thanks RRB

Tirth
  • 7,801
  • 9
  • 55
  • 88

3 Answers3

1

There is a refactoring that will convert your classes to be compatible with ARC.

In XCode menu: Edit - Refactor - Convert to Objective-C ARC.

Andrey Zverev
  • 4,409
  • 1
  • 28
  • 34
  • suppose i refactoring all classes in ARC environment then it will execute already written retain, release keywords? Also suppose it will Ran in ARC environment then it will run in lower version of iOS 5? – Tirth Dec 15 '11 at 06:12
  • @RRB: refactoring will remove all retain and release keywords because they are not needed anymore, ARC code will run on iOS 4.x and later. – Andrey Zverev Dec 15 '11 at 06:33
  • Thanks dude it working for me on simulator only let me check on device. – Tirth Dec 15 '11 at 06:36
1

See this question for an explanation of how to disable ARC on a per-file basis. The solution here is probably to disable ARC for the Kal files while leaving it enabled for the rest of your project. (ARC works fine on iOS 4.0 with a couple of minor exceptions.)

Community
  • 1
  • 1
Simon Whitaker
  • 20,506
  • 4
  • 62
  • 79
0

You can turn the ARC off in the Xcode 4.2 for your project.

For more info , see the blogpost

Also , see this SO question

Community
  • 1
  • 1
Ilanchezhian
  • 17,426
  • 1
  • 53
  • 55