問題描述
誰能幫我記住告訴 XCode 對某些文件不使用 ARC 的標志是什么?我的項目中有幾個文件被標記為這樣...直到我添加了另一個文件并決定將其轉換為 ARC.聽起來很容易,對吧?我希望我能夠簡單地檢查我想要的文件并讓 XCode 發揮它的魔力.好吧,不是那么容易,在預檢查期間它從文件中刪除了所有 -Noarc 標志,現在我需要手動將標志重新應用于多個文件.
Can anyone help me remember what was the flag to tell the XCode to not use ARC for some file? I had several files in my project marked as such... Until I added another file and decided to convert that one to ARC. Sounds easy, right? I expected that I would be able to simply check a file that I want and let the XCode do it's magic. Well, not so easy, during pre-check it stripped all -Noarc flags from the files and now I need to manually re- apply the flag to several files.
這個故事的寓意是:一旦您的項目在 ARC 中并且您有一些文件標記為無 ARC,請不要從 Refactor>Convert to ARC 重新運行轉換為 ARC 工具.即使預檢查失敗,它也不會恢復您的設置.
the moral of this story is: once your project is in ARC and you have some files marked as no ARC, do not re-run the convert to ARC tool from Refactor>Convert to ARC. It will not restore your settings even if pre-check fails.
推薦答案
我找到了答案:要從 ARC 中排除文件,請在構建階段使用 -fno-objc-arc 標志>compile來源
I found the answer: to exclude the file from ARC, use the -fno-objc-arc flag in build phases>compile sources
這篇關于ios5 ARC 什么是從 ARC 中排除文件的編譯器標志?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!