IOS ARC completed?

A former developer created a well-written iPhone app for our organization. After he left, another developer updated the application for automatic reference counting (ARC). This developer is no longer there. I do not believe what he did, as he was an unscrupulous developer. I have 15 years of development experience, but I'm new to iPhone development. I need to know if I should leave his changes intact. I carefully compared the changes he made. He just took out the dealloc functions and removed the use of "release", "save" and "autorelease". From what I read http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html :

You cannot explicitly refer to dealloc, or implement or invoke save, release, save, or auto-advertise.

This should be ok.

However this article

http://www.learn-cocos2d.com/2011/11/everything-know-about-arc/

mentions

If LLVM 3.0 is selected as the compiler, you can set the YES setting for the Objective-C Build Customization option for Objective-C.

This parameter is still set to NO. It seems to me that the code has been updated to use ARC, but the project is not configured for ARC. Could you tell me how to proceed?

+4
source share
2 answers

Well, this parameter should be set to YES, probably the code is flowing everywhere.

You can check if the project is running using the analyzer (Product β†’ Analyze).

If ARC is disabled and releases are removed from the code, the analyzer will inform you that your code is leaking and where.

So, after turning on the ARC, the analyzer will not give you any leaks.

Another way to check if ARC is disabled or turned on is using release or autostart in your code. If ARC is enabled, you should see a warning or error.

+7
source

You mentioned LLVM 3.0. This means that you can deploy your application in iOS 4. If so, beware that ARC has a limitation in iOS 4, known as " ARClite ": Weak links are not automatically nullified (nil'd out). You must explicitly use them in your code. In practice, this means no output signals.

Apple Document: Objective-C Feature Availability Index

0
source

Source: https://habr.com/ru/post/1486669/


All Articles