Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Create an instance of the MKMapView class and add it to a view or
assign it as a subview of your view controller. Here is the sample
.h file of a view controller that
creates an instance of MKMapView
and displays it full-screen on its view:
#import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface Creating_a_Map_ViewViewController : UIViewController @property (nonatomic, strong) MKMapView *myMapView; @end
This is a simple root view controller with a variable of type
MKMapView. Later in the
implementation of this view controller (.m file), we will initialize the map and
set its type to Satellite, like
so: