iOS5 convert project to ARC fails due to "Error in format of file" How to fix?
Asked Answered
L

1

13

I got a project with 49 source files that I'm trying to convert to ARC using edit>refactor>convert to arc. I click "pre-check", there are no errors, and the target compiles.

Xcode goes through "generating preview", compiles all 49 source files, then shows me 1 (or 2) file in the review changes list. This is a .h/.m file. That one appears correct. There are no other files on that list and I see.

When I click save, the window closes, and the project tries to build, but fails with error:

Error in format of file: ...-arc.migrate/remap

These errors appearing in all files

If I try to build the project, i get ~350 errors saying "retain, release not allowed in ARC"... Please help!

How do I convert the entire project to ARC at once?

Update: After cleaning the project a bunch of times and changing the deployment target to iPhone 5 simulator, I was able to see all files in the "save changes" list.

Loomis answered 13/10, 2011 at 15:51 Comment(1)
Rather than editing your question to provide the answer, you can post an answer as an official 'answer' to your own question, and then mark that as accepted... it is encouraged behavior, as it moves the question off the "unanswered" list. :)Reprisal
L
12

I found a way to answer this question and am posting it here for clarity:

After cleaning the project a bunch of times and changing the deployment target to iPhone 5 simulator, I was able to see all files in the "save changes" list.

Loomis answered 7/11, 2011 at 4:44 Comment(3)
The key there is changing the target to Simulator. There are not enough up votes in the world for this answer.Gilles
For me the error never resolved in-spite of changing the target to simulator. I found that I was working on the wrong Xcode Build number Build 4C177. I switched to Build 4C199 and the error got clearedPoleaxe
I am on build 4C199 (Xcode 4.2), Running on OS X 10.6.8 and still no luck... Cleaned, set Scheme to iPhone Simulator 5.0 (Debug), but the 'Generate Preview' phase shows 'No Editor' and once complete (no warnings) the retains/releases remain but the project flag alone is set (objc-arc) so build fails.Heise

© 2022 - 2024 — McMap. All rights reserved.