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
instance of CLLocation , which contains the latitude and longitude of the device ( Fig-
ure 4.5 ) . It also contains the accuracy of its reading and, depending on the device, the el-
evation above sea level.
Figure 4.5 A CLLocation object
 
Search WWH ::




Custom Search