Typical dealloc
Well it sucks. What about if I forget a property to dealloc?
Why can’t we have something like dealloc All properties
Worst of all, I sort of like the way viewControllers are handled now. We put a property and poof the dealloc is put. Can’t have that on normal classes ha?
- (void)dealloc
{
[_window release];
[__managedObjectContext release];
[__managedObjectModel release];
[__persistentStoreCoordinator release];
[_MainBadgerApplication release];
[_SettingsMiscelaneous release];
[_theNearByIsiKota release];
[Customcell release];
[PhoneCC release];
[searchViewController release];
[_superTabBar release];
[_SuperNavBar release];
[pinNumberView release];
[_lblForPinNumber release];
[navController release];
[NearbyShortcut release];
[_searchListView release];
[_searchNearView release];
[LoadingView release];
[super dealloc];
}
I am thinking of a macro where I can just do
myDealloc
and that will enumerate all properties and release them one by one or set them to nil (which is almost equivalent)
This looks like a horrible idea, so here is the code 😀 This will step through every object property on your code and send a release. I didn’t compile it, but it’s more or less like this.
You can wrap it in a C function and call it from your dealloc.