Graphics Programs Reference
In-Depth Information
• A
UIActivityIndicatorView
indicates that the device is working and not
stalled.
• A
UITextField
allows the user to input text to label the current location on the
map.
The model objects are on the bottom. One is an instance of
CLLocationManager
,
which interacts with the device's hardware to determine the user's location. The other
model objects are instances of a class called
BNRMapPoint
, which you will create later
in this chapter.
In the middle of everything is the controller object,
WhereamiViewController
.
WhereamiViewController
is responsible for processing updates and requests from
objects and for updating the user interface. It is the delegate for the
MKMapView
, the
UITextField
, and the
CLLocationManager
.
Take a look at the messages these objects send to their delegate, the
Wheream-
iViewController
.
MKMapView
sends
mapView:didAddAnnotationViews:
when a view (or views) is added.
UITextField
sends
textFieldShouldReturn:
when the user has finished entering text.
CLLocationManager
sends
loca-
tionManager:didUpdateToLocation:fromLocation:
to inform
Wheream-
iViewController
of a location update.