dealloc method gone from the ViewController implementation file template in Xcode 4?
I'm new to iOS development.
From the book I'm reading, I understand that Outlets need to be released in two places i开发者_开发问答n the ViewController implementation file (.m).
Like this:
- (void)viewDidUnload {
self.statusText = nil;
}
- (void)dealloc {
[statusText release];
[super dealloc];
}
Apple automatically adds these two methods (viewDidUnload and dealloc) to the implementation file when you create a new project.
However, I noticed that with the new Xcode 4 the "dealloc" method does not seem to be there?
Is this something I should add manually or has Apple maybe removed the need to release the outlets in two places?
Anyone know? Thanks!
Most likely you have created a project that uses the new ARC (Automatic Reference Counting) and therefore do not need the dealloc method because calling retain
or release
is no longer allowed when compiling with this option.
精彩评论