I’m trying to compile the following code however I get an error on the indicated line:
#pragma mark CLLocationManagerDelegate Methods
//**error expected identifier before "{" token**
-(void)locationmanager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)
{
MKCoordinateSpan span;
span.latitudeDelta = 0,2;
span.longitudeDelta = 0,2;
MKCoordinateRegion region;
region.span = span;
region.center = newLocation.coordinate;
[viewController.mapview setRegion:region animated:YES];
viewController.mapview.showsUserLocation = YES;
viewController.latitude.text =[NSString stringWithFormat:@"Xf", newLocation.coordinate.latitude]
viewController.longitude.text =[NSString stringWithFormat:@"Xf", newLocation.coordinate.longitude]
}
@end
How can I fix this?
You need an argument name before the trailing
{on the first line, e.g.