在.h中加入属性
//创建属性
@property(nonatomic,strong)NSString *provie;
导入头文件
//导入系统类
#import <MapKit/MapKit.h>
//导入获取经纬度类
#import <CoreLocation/CoreLocation.h>
//设置协议
@interface MapUIkit ()
<MKMapViewDelegate,CLLocationManagerDelegate>
//创建地图对象
@property(nonatomic,strong)MKMapView *MapView;
@property(nonatomic,strong)CLLocationManager *lomanger;
@end
@implementation MapUIkit
-
(void)viewDidLoad {
[super viewDidLoad];
//设置导航标题
self.navigationItem.title =self.provie;
//设置右侧按钮
//self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@“省会定位” style:UIBarButtonItemStyleDone target:self action:@selector(YOU:)];
//实例化
self.MapView = [[MKMapView alloc] initWithFrame:self.view.fram