A former developer built a well-written iPhone app for our organization. After he quit, another developer updated the app for Automatic Reference Counting (ARC). This developer is no longer here. I don't trust what he did as he was an unscrupulous developer. I have 15 years of development experience, but I am new to iPhone development. I need to know if I should leave his changes intact. I have carefully compared the changes he made. He only took out the dealloc functions and removed use of 'release', 'retain', and 'autorelease'. From what I've read http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html:
You cannot explicitly invoke dealloc, or implement or invoke retain, release, retainCount, or autorelease.
This should be ok.
However, this article
http://www.learn-cocos2d.com/2011/11/everything-know-about-arc/
mentions
With LLVM 3.0 selected as compiler the Build Setting Objective-C Automatic Reference Counting can be set to YES.
This setting is still set to NO. It seems to me that the code was updated to use ARC but the project is not configured for ARC. Can you please tell me how to continue?
Well, that parameter has to be set to YES, probably the code is leaking everywhere.
You can check if the project is leaking using the Analyzer (Product -> Analyze).
If ARC is disabled and the releases are removed from the code, the analyzer will inform you that your code is leaking, and where.
So, after enabling ARC, the analyzer wont give you any leaks.
Another way of checking if ARC is disabled or enabled is using release or autorelease in your code. If ARC is enabled, you should see a warning or an error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With