Iterate attributes and IBOutlets of a UIViewController
- by Espuz
I've a generic UIViewController on my app. All the UIViewController on the app inherits from this generic one.
I'm trying to automate the deallocation and releasing of attributes and IBOutlets as properties.
I'm doing the first (attributes) on dealloc method and the second (IBOutlets as properties) on viewDidUnload.
- (void) dealloc {
[_att1 release];
_att1 = nil;
[_att2 release];
_att2 = nil;
// ...
}
- (void) viewDidUnload {
self.att1 = nil; // att1 is an IBOutlet
self.att2 = nil; // att2 is an IBOutlet
// ...
}
Is there any way to iterate all my attributes and IBOutlets to simplify this operations? I want to avoid do it for each outlet and attribute and delegate it to the generic UIViewController.
Thanks.