4

I'm running the ARC conversion tool for the first time. I've followed the instructions and dealt with all of the issues/erros in my files that the conversion tool finds before it will actually run. I also have several third party libraries that I've told ARC to skip by unchecking them in the Targets to Convert dialog. After running the tool it shows me a report of all the changed files but no files have been changed. Next I save and try to build the project only to find that I have nearly 1000 build errors due to all the calls to retain and release in my project. It's my understanding that the conversion tool is supposed to remove all calls to retain, release, and autorelease but that isn't the case for me.

Has anybody encountered this problem before and if so how did you solve it? Or is it my responsibility to remove all retains & releases from my app? If so I'm not sure what the point of the conversion tool is. Please advise.

Thanks in advance

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
jmurphy
  • 1,891
  • 3
  • 22
  • 28
  • 1
    I tried the automatic ARC conversion on two projects. On one, it worked fine. It identified some things to fix. Once I fixed them, I did the conversion again and hit 'save'. It made all the changes and all was good. On the second project, I have a similar experience as you. It shows me all the changes it would make for ARC, I click Save, and it just beeps (like and error) and nothing happens. I tried unchecking some files as you did and then save works but I have tons of build errors as you do. Wish I could help but hope someone here posts a solution. – XJones Oct 23 '11 at 04:39
  • Since posting this I went through and manually removed all occurrences of retain, release, autorelease, and autorelease pool's. It sucked bad but I'm now able to run the app in ARC mode. I'd still love to find a real solution to this problem though. – jmurphy Oct 24 '11 at 23:14
  • Please be sure to file a bug report on this: https://bugreport.apple.com , because that doesn't sound like correct behavior. – Brad Larson Oct 25 '11 at 18:30
  • I'm exactly in your situation... i tried to create a totally new project (with ARC by default) and manually add converted file from the old project... but i obtain the exactly list of errors. – MatterGoal Nov 17 '11 at 09:28

2 Answers2

6

I am about to try this on my own rather large project, so I may be back with more questions, but I found this that might help: http://meandmark.com/blog/2011/11/xcode-4-2-convert-to-arc-troubleshooting/

Are you using GIT repositories for your code? It may not be converting due to the snapshot issue described.

jbcaveman
  • 911
  • 1
  • 10
  • 19
  • 1
    A good walkthrough, mentioning again the snapshot issue (bottom of the post) causing the SAVE button to not function: http://www.daveoncode.com/2011/10/24/migration-to-arc-automatic-reference-counting-using-xcode-4-2-refactor/ – jbcaveman Dec 02 '11 at 23:54
  • I followed both suggested steps above and the save button still didn't work. I ended up Going to File->Project/Workspace Settings->Snapshots and unchecked the "Create snapshot of project before mass-editing operations" and this finally allowed me to press the save button. Not sure if the above two steps were necessary. – Jon C Dec 28 '11 at 00:05
3

This works better in case you allow it to continue building if errors encountered (Preferences - General). However, not all files are changed or converted completely anyway. But a few regulars will do the dirty job.

find-replace-window

In case anyone wants to copy and paste;

\[([\[\w\s\]]+) autorelease\]
PaulB
  • 962
  • 7
  • 15
Aleks N.
  • 6,051
  • 3
  • 42
  • 42