釋放是否有任何潛在的內存問題,用下面的代碼?:iOS的內存問題,在viewDidLoad中初始化和viewDidUnload
- (void)viewDidLoad
{
locationManager = [[CLLocationManager alloc] init];
}
- (void)viewWillAppear:(BOOL)animated {
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
}
- (void)viewDidUnload
{
[locationManager release];
locationManager=nil;
[super viewDidUnload];
}
我與儀器檢查,它說有內存上面的代碼泄漏。
你是正確的...我與儀器檢查,並有一個內存上面的代碼我張貼..泄露這就是爲什麼我問這個問題......它似乎與dealloc工作正常.. – MomentH