Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We modify the Hello Location - Location Updates example, to add course and speed values in the Hello Location app.
Hello_LocationViewController.h file, and add two outlets, one for the speed data and another for the course data.@property (retain, nonatomic) IBOutlet UITextField *courseText; @property (retain, nonatomic) IBOutlet UITextField *speedText;
UITextFields in our XIB file as shown in the following screenshot. Also, we connect the same to the outlets created previously. ViewDidLoad method, we change the location manager's accuracy to kCLLocationAccuracyBestForNavigation. didUpdateToLocation and locationDetect, we fetch the values of speed and course from the CLLocation object.courseText.text = [[NSString alloc] initWithFormat:@"%f",newLocation.course]; speedText.text = [[NSString alloc] initWithFormat:@"%f",newLocation.speed];