What properties should I set to nil in viewDidUnload?-Collection of common programming errors
I don’t know if I’m using viewDidUnload properly. Should I release all stuff I declare in my .h file?
Here is how I’m doing it now:
@property (strong, nonatomic) Readability *wrapper;
@property (strong, nonatomic) ArticleModel *article;
@property (strong, nonatomic) Woho *wohoItem;
@property (strong, nonatomic) FeedItem *item;
@property (unsafe_unretained, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) NSMutableArray *picturesArray;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *headTitleLabel;
and in viewDidUnload:
- (void)viewDidUnload
{
[self setHeadTitleLabel:nil];
[self setScrollView:nil];
self.picturesArray = nil;
self.item = nil;
self.article = nil;
self.wohoItem = nil;
self.wrapper = nil;
}
Is this the right thing to do?
Probably not, because my app crash on every memory warning.
Thanks!