Changes

An Example iOS 4 iPhone Location Application

16 bytes added, 18:46, 15 February 2011
no edit summary
@property (nonatomic, retain) IBOutlet UILabel *distance;
@property (nonatomic, retain) CLLocation *startLocation;
- (IBAction)resetTripresetDistance;
@end
</pre>
== Designing the User Interface ==
The user interface for this example location iPhone app is going consist of a number of labels (some of which will be connected to the outlets declared in the preceding section) and a button that will be connected to the previously declared resetTrip resetDistance action. Initiate the user interface design process by double clicking on the locationViewController.xib file to launch Interface Builder. Once the tool has loaded, create a user interface that resembles as closely as possible the view illustrated in the following figure:
== Implementing the Action Method ==
The button object in the user interface is connected to the resetTrip resetDistance action method so the next task is to implement that action. All this method needs to do is set the startlocation object to nil:
<pre>
-(void)resetTripresetDistance
{
startLocation = nil;