0

I have an app that uses the ABAddressBook API and I am trying to convert my app to use ARC.

I know the AddressBook API is written in native C and its giving me a lot of errors when ARC is enabled.

Anybody knows how to do it or is it even worth to do it?

Thanks in Advance.

Kazuki Sakamoto
  • 13,929
  • 2
  • 34
  • 96
bartender
  • 31
  • 1
  • 6

2 Answers2

0

One possible solution is to set compiler flags for the code that is giving you trouble to convert to. Go to Build Settings for the particular target you are using and add the flag "-fno-objc-arc" to the files that are problematic. Also, any more info on the actual problems arising would be helpful.

tonyl7126
  • 1,548
  • 3
  • 14
  • 19
0

bartender,

First, working code is working code. You can easily intermix both kinds of memory management mechanisms in the same app. I only convert classes to ARC as I open the code up for other purposes. This allows me to slowly move my app to ARC. Why do you want to change this code to use ARC?

Second, the interface between core foundation items and ARC can appear to be complex ... but it isn't. Most issues are handled by using the __bridge type qualifier. Typically, the compiler/fix-it tells you exactly what you need to do. (Working, non-leaking CF code doesn't need to change. It just needs to tell ARC to leave it alone.)

Andrew

adonoho
  • 4,339
  • 1
  • 18
  • 22