Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARC or not to ARC iphone iOS5 [closed]

I have developed an iPhone application which should support iOS4 and iOS5 based iPhone/iPad.

my application leaks memory at few places which is becoming hard to debug due to the size of code. I recently read about ARC (Automatic Reference Counting), my query is

  1. do i need to modify my source code (retain/release /alloc/dealloc) to compile with ARC. also what all changes we need to perform using ARC?

  2. is it advisable to shift to ARC?

  3. will my app work on iOS4 phone if i use ARC

thanks.

like image 930
Rohit Avatar asked Jan 05 '12 20:01

Rohit


1 Answers

This is probably not the best place to have posted this question, but I will answer because I don't mind the question being here.

http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html

  1. you will use the migration tool 'Edit > Refactor > Convert to Objective-C ARC' and hand fix anything the tool can't figure out.

  2. Yes.

  3. Yes but Zeroing weak references will not.

like image 94
griotspeak Avatar answered Oct 04 '22 02:10

griotspeak