0

Possible Duplicate:
Xcode 4.2 with ARC: will my code run even on iOS devices with firmware older than 5.0?

I am confused with ARC concept & reference counting technique.I have created an application in ios4 .In ios4 there is no ARC concept so programmer has to take care of memory when releasing objects using reference counting.If programmer forget to release objects when created an application in ios4 if same application is run in ios5 what happens to unreleased objects?

Community
  • 1
  • 1
Sowji
  • 35
  • 1
  • 8
  • 1
    It sounds like you haven't read the documentation. By enabling ARC the compiler generates the appropriate code to retain and release your objects. If you have specific questions about how that works, you should ask those questions after reading this: https://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226 – i_am_jorf Oct 21 '12 at 04:41

1 Answers1

2

ARC is a compile time option, it is not tied to a specific version of iOS. IF you have a non-ARC app built with iOS 4 SDK and you run it under iOS 5 or iOS 6, it still runs the same. If you have a memory leak under iOS 4, you will have the same leak under any other version of iOS.

To take advantage of ARC, you must convert your app to use ARC and compile the project with ARC enabled.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Au contraire, ARC ***is*** tied to a specific version of iOS (late 4.x, and even then, it's called ARCLite). – CodaFi Oct 21 '12 at 04:56
  • @CodaFi The OP appears to be under the impression that ARC comes along with iOS 5, at runtime. My point is that ARC is a compile time feature, not a runtime feature tied to a specific version of iOS. ARC is a feature of the LLVM compiler. – rmaddy Oct 21 '12 at 05:00