In my appDelegate.h file I do this:
CLLocationManager *locationManager;
and
@property (nonatomic, retain) CLLocationManager *locationManager;
Then later in the .m file:
...
@synthesize locationManager;
...
if ([CLLocationManager locationServicesEnabled])
{
[myGizmoClass setLocationManagerDisabled:FALSE];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[self.locationManager setDistanceFilter:kCLDistanceFilterNone];
[self.locationManager startUpdatingLocation];
...
Yet I am getting the following in XCode 4.5 (see image attached)
(Object leaked: allocated object is not referenced later in this code execution path)
What the heck? I reference it right after that line.
I am not seeing the issue. PS: No crash, or anything. Let me be clear. This is working as it is. I just hate the error. I am QUITE sure that I am missing something silly. Can anyone help?
Please do not post anything with regards to "You don't have to do @property anymore", etc. This code was written back for xcode 3.5-4~ish and I prefer being specific because I hate having to flip back and forth between the shorthand that XCode 4.5 allows and what older projects require (and still have in their source code). So I still use the full definitions in the .h file. I figured that the major change to programming style would come with the next major update of the app. (thanks for understanding)
autorelease
the location manager immediately after you create it. – Quarterdeck