int someFunction (CLLocation *currentLocation) {
double latitude = 12.3f;
double longitude = 22.5f;
CLLocationDistance d1 = [currentLocation distanceFromLocation:
[[CLLocation alloc] initWithLatitude:latitude longitude:longitude]];
return 0;
}
int someFunction (CLLocation *currentLocation) { double latitude = 12.3f; double longitude = 22.5f; CLLocationDistance
Share
Yes. Objective-C’s memory management can seem complicated, but remembering one fundamental rule will take you far:
You call
allocwithout areleaseorautorelease, so you are breaking the rule.