I am developing exclusively for iOS 5 using ARC. Should IBOutlet
s to UIView
s (and subclasses) be strong
or weak
?
The following:
@property (nonatomic, weak) IBOutlet UIButton *button;
Would get rid of all of this:
- (void)viewDidUnload
{
// ...
self.button = nil;
// ...
}
Are there any problems doing this? The templates are using strong
as are the automatically generated properties created when connecting directly to the header from the ‘Interface Builder’ editor, but why? The UIViewController
already has a strong
reference to its view
which retains its subviews.