Is dealloc called after viewDidUnload?

Quick question, after viewDidUnload calls the dealloc call? I ask regarding pickerData, I realized that the variable will be released when dealloc is called. My reason for asking, as I noticed in one book, is that the author sets pickerData to nil in viewDidUnload. Is this a harmless excess, maybe even good practice, or is there no scenario in which it would not be possible to call without another.

INTERFACE:

@interface SingleViewController : UIViewController {
    NSArray *pickerData;
}
@property(nonatomic, retain) NSArray *pickerData;
@end

IMPLMENTATION:

-(void)viewDidUnload {
    [self setSinglePicker:nil];
    [self setPickerData:nil]; 
    [super viewDidUnload];
}

-(void)dealloc {
    NSLog(@"Here");
    [singlePicker release];
    [pickerData release];
    [super dealloc];
}
@end

Gary

+3
source share
1 answer

, viewDidUnload: , UIViewController. dealloc: , UIViewController . - .

ivars nil, , ivars . viewDidUnload: , , . , , : " , , , . , , viewDidLoad:.

ivars nil , dealloc nil, Objective-C.

+6

Source: https://habr.com/ru/post/1732409/


All Articles