Sorry but there are so many issuea wrong with this code.
Remove the ;
from the end of @implementation CLLocationManagerDelegate;
and @implementation ViewController;
and get rid of the {
and }
from @implementation ViewController; {
and } @end
This method - (void)startStandardUpdates
is also missing the { }
brackets replace
- (void)startStandardUpdates
{
// if(nil == locationManager) This is just silly change to below
if (locationManager == nil)
locationManager = [[CLLocationManager alloc] init]; // Because there are no {} wrapping this if statement this is the only line that will run if locationManager is nil
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
locationManager.distanceFilter = 250;
[locationManager startUpdatingLocation];
}
Side Notes
When it comes to convention the a method should be declared with the first letter as lower case so the below methods
- (IBAction)Parked:(id)sender { }
- (IBAction)WheresMyCar:(id)sender { }
should become
- (IBAction)parked:(id)sender { }
- (IBAction)wheresMyCar:(id)sender { }
Since your subclassing CLLocationManager
I wouldn't recommend using the name CLLocationManagerDelegate
this could create some confusion. I would recommend something along the lines of just @interface LocationManager : CLLocationManager
or prefix it with the something else like company initials, so for the company I work for this would become @interface PPDLocationManager : CLLocationManager
Also the reason behind why you shouldn't be using the name CLLocationManagerDelegate
as your class is because it is already a protocol name see the Apple Documentation for CLLocationManagerDelegate
The Below methods are in the wrong @implementation
- (void)viewDidLoad
- (void)didReceiveMemoryWarning
they should be in your ViewController
implementation not your CLLocationManagerDelegate
implementation.