deallocの場合、releaseですが、viewDidUnloadの場合、nilを設定するそうです。
------------- sample code ------------------
@synthesize nameField;
@synthesize numberField;
@synthesize sliderLabel;
@synthesize leftSwitch;
@synthesize rightSwitch;
@synthesize doSomethingButton;
- (void)viewDidUnload {
self.nameField = nil;
self.numberField = nil;
self.sliderLabel = nil;
self.leftSwitch = nil;
self.rightSwitch = nil;
self.doSomethingButton = nil;
[super viewDidUnload];
}
- (void)dealloc {
[nameField release];
[numberField release];
[sliderLabel release];
[leftSwitch release];
[rightSwitch release];
[doSomethingButton release];
[super dealloc];
}
------------------------------
0 件のコメント:
コメントを投稿