Graphics Programs Reference
In-Depth Information
In
WhereamiViewController.m
, update the
initWithNibName:bundle:
method to set the
delegate
property of the location manager to be the instance of
WhereamiViewController
.
locationManager = [[CLLocationManager alloc] init];
// There will be a warning from this line of code; ignore it for now
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
Two of the arguments of
locationMan-
ager:didUpdateToLocation:fromLocation:
are instances of a class named
CLLocation
. (All of the classes in the Core Location framework are prefixed with
CL
.)
When a
CLLocationManager
has enough data to produce a new location, it creates an
evation above sea level.
Figure 4.5 A CLLocation object