I’m having a memory leak and I have no clue where it comes from and how to fix it.
At some point i calculate the distance between 2 locations.
double calc = [self getDistance:location to:otherLocation];
NSNumber *distance = [NSNumber numberWithDouble:calc];
in instruments i get as leaked object NSCFNumber and it identifies
NSNumber *distance = [NSNumber numberWithDouble:calc];
as the line causing this.
I’m at a loss. Please help.
thanks in advance,
Michiel
There’s nothing wrong with what you’re doing there. The
NSNumberhas a +0 retain count (autoreleased), so you’re probably retaining thatNSNumbersomewhere else and forgetting to release it.