I constantly encounter situations with UIViewControllers containing a large number of IBOutlets connecting the controller to its views (usually UILabels).
Following the "best practices", i.e. Use retention in all elements of the user interface: @property (retain, nonatomic) UILabel *theElement1, @property (retain, nonatomic) UILabel *theElement2... it gives me an insane amount of boiler plate code dealloc, and viewDidUnloadfor the type of controller.
Offensive IBOutlets are never used or installed outside the UIViewController (the set method is used only in viewDidUnload and when nib is loaded), except automatically when nib is loaded.
The result of the "best practice":
deallocoverwhelmed [theElement1 release], [theElement2 release]etc.viewDidUnloads [self setTheElement1:nil], [self setTheElement2:nil]etc.
However, since all of these elements are known to be preserved in appearance in any case, and the view will be released by the UIViewController at appropriate times, I see absolutely no reason for me to manually manage this.
The reason for this particular “best practice” (as far as I can tell) is to match your conservation. But as soon as you start to have a large number of outlets, you most likely will not be able to process any outlet anywhere in either of the two methods, than you will have problems with correctly replacing the outlets with “save” for those special outlets that you really want to keep even after the performance is forgiven.
- " " , , , "" subviews UIViewController?