Get Updates By E-mail 

Article Written By:
Johann Dowa

Macros Allowing You To Easily Create Code That Works In Both ARC and Non-ARC Projects

  •  
  •  
  •  
  •  
  •  

On this site I feature many different open source libraries, and with the addition of automatic reference counting to the iOS SDK getting these projects to work can be tedious.

If you are trying to use a library that is not created to work with ARC enabled projects you can turn off ARC altogether for the library files, or convert the project.

However, if you are working on a project, and wish not to use ARC you’re kind of stuck.

Fortunately John Blanco has written a set of macros that you can use with your code that will automatically make it work with both ARC and non-ARC projects.

For example you’d use the SAFE_ARC_RELEASE  macro in place of your regular release statement and in ARC enabled projects the statement gets wiped out, and acts as a regular release statement in non-ARC enabled projects.

These macros aren’t terribly complex just a great idea.

You can find the macros along with a usage guide on here.

Very handy if you’ve got an open source library and want to satisfy everyone.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments