"viewDidUnload"의 개체를 제외하고 Apple의 권장 사항에 대한 정보를 Core Data 튜토리얼에서 찾아 볼 수 있습니다. 예 :"viewDidUnload"에있는 객체를 없애라는 Apple의 조언에 대한 설명?
- 이것이 중요한 이유는 무엇입니까? nil'ing을 릴리스하는 것과 다른가요?
- 이 최선의 방법입니다./내가 본 적이 없으며 이것을 보지도 못했지만 일부 iPhone 예제 코드에서 보았을 것으로 생각하지 않습니다.
코드 :
// The implementation of viewDidUnload should relinquish ownership
// of anything created in viewDidLoad that can be recreated.
- (void)viewDidUnload {
self.eventsArray = nil;
self.locationManager = nil;
self.addButton = nil;
}
- (void)dealloc {
[managedObjectContext release];
[eventsArray release];
[locationManager release];
[addButton release];
[super dealloc];
}
[가능한 경우 - (void) viewDidUnload - -dealloc 아닌 개체를 해제해야합니까?] (http://stackoverflow.com/questions/1158788/when-should-i-release-objects-in- voidviewdidload보다는 오히려 dealloc) – Mark