In xcode 4.2 I have found it very frustrating because you can’t use:
-(void)dealloc {
[label release]; //'release' is unavailable
[super dealloc]; //'dealloc' is forbidden in automatic reference counting
}
Is there another way because autorelease and other deallocs don’t work either.
Xcode 4.2 introduces “Automatic Reference Counting” (aka ARC). This is a compiler feature that basically inserts the retain and release calls for you. Under ARC, if you have a pointer to an object, you’re retaining it. When your pointer goes out of scope, or is reassigned to point to another object, the original object is released. It’s really nice.
So, in short, you just remove all the calls to
retain,release, andautorelease, and the compiler will do the right thing for you.