To expand upon @Joel's answer, this is not a change between ARC and manual reference counting (MRC). In MRC code with a NIB, only your root-level view is declared as:
@property (nonatomic, retain) IBOutlet UIView *view;
All subviews of self.view
should be declared as:
@property (nonatomic, assign) IBOutlet UIView *aSubView;
When this is converted to ARC, it should be like this:
@property (nonatomic, strong) IBOutlet UIView *view;
@property (nonatomic, weak) IBOutlet UIView *aSubView;
The reason for this is to save work (and complexity) in your -viewDidUnload
method. When your root-level views are released, all subviews will be automatically released. If you a strong reference, the subview will not be deallocated unless your -viewDidUnload
explicitly contains:
self.aSubView = nil;
Anyone reading this far will note that -viewDidUnload
is depreciated as of iOS 6.0. That renders much of this irrelevant, but it's still good practice to follow the conventions.