The Dealloc method has disappeared from Xcode 4.1. UIViewController Template

I used Xcode 3.2.4 when running iOS apps, but now I have switched to Xcode 4.1 with the iOS 4.3 SDK. I noticed that now the dealloc method is not added automatically when I create the UIViewController class from the Xcode template, as in Xcode 3. Searching over the Internet brings me that this can happen if I create a project with ARC (automatic reference count), but , as I know, this function is implemented only in Xcode 4.2.

Should I manually add the dealloc method?

+4
source share
2 answers

You can just go and add dealloc. If ARC is really enabled, you will receive complaints from the compiler.

Even when using ARC, dealloc is still sometimes required if you need to do something other than freeing objects (like un-resgister observers).

+1
source

If you do not use ARC, yes ... Use the dealloc method, as usual.

If ARC is enabled, you should receive warnings when explicitly using dealloc . Also check your project settings for added security. You can use a project created with Xcode 4.2 in Xcode 4.1.

In this case, the ARC setting will be located at the bottom, and not in the usual place, since it should not be recognized by Xcode 4.1.

0
source

All Articles