2

I'm making a static library product. I want to use ARC but one of my customer want to target their app to iOS 3.2. They also want to target ARMv6 architecture.

OK. I have to accept the requirement. As I know, ARC without weak reference is just compiler feature, so I think there's no difference in static library itself or it will not require iOS 4.0. But as I know, Apple limited minimum iOS as 4.0. So I cannot decide this myself, because I have no 3.2 device :(

Is here anyone who tested ARC code on iOS 3.2? If it runs well, I will transit to ARC, and compile my library with ARC, and pass the library to my customer. I think I can force them to use 4.0, but I'm not sure about ARMv6. Of source there is no reason ARMv6 will not work, but the fact that I cannot test makes me to worry. Please let me know about your experience.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
eonil
  • 83,476
  • 81
  • 317
  • 516
  • 1
    As I mention in my answer, there's a subtle difference involving static library compatibility on iOS 4.x, so that question isn't a complete duplicate of yours. – Brad Larson Feb 10 '12 at 18:24
  • Thanks @BradLarson. Close vote cannot be removed :( – eonil Feb 11 '12 at 10:46

2 Answers2

3

Automatic reference counting requires the modern runtime to work (present in iOS 4.0 and 64-bit Snow Leopard), so ARC-enabled projects cannot target iPhone OS 3.x. They will fail at runtime.

Deploying an ARC-enabled static library to iOS 4.x has one slight hitch that you should be aware of. As I describe in this answer, if someone uses your ARC-enabled static library within a non-ARC application, they'll need to manually link in the libarclite_iphoneos.a library if they target this application at iOS 4.x. This is included by default in ARC-enabled applications, but will be missing from non-ARC applications that link against ARC-enabled libraries.

Community
  • 1
  • 1
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
0

ARC is availible with SDK 5.0 and iOS 4.3 runtime

You may want to check out http://clang.llvm.org/docs/AutomaticReferenceCounting.html for details

A lot of good info on building static libraries in this post also: http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html

oanoss
  • 86
  • 4