我有一个应用程序,我没有在整个应用程序中使用 ARC。但是在某些视图控制器中,我通过 compler 标志使用它-fobjc-arc
。我不知道它会如何工作,以及它的优点和缺点,这是一个好的技术吗?这样做有什么不利影响吗?任何机构都可以有这种经历吗?有谁能够帮助我?。另外我正在使用 Xcode 4.2 和 LLVM compiler3.0。它实际上是一个非弧视图控制器。但是我添加了编译器标志。并删除了版本的编译错误。够了吗
3 回答
There will be no issues with this approach.
ARC is a compile-time feature, it'll insert retain, release calls in your arc code at the compile time.
So your arc code will be same as your non-arc code after compilation. So I think there will be no issues with this approach.
But converting the entire project to ARC will be the best approach, because you don't need to worry about the retain, release calls
However i found this to be extremely tricky and find this article is a well written example for my cause.http://www.codeography.com/2011/10/10/making-arc-and-non-arc-play-nice.html