Iphone MKMAPView不显示地图
我使用下面的代码来显示给定lat-lon值的图像,但它给出了错误Iphone MKMAPView不显示地图,iphone,objective-c,Iphone,Objective C,我使用下面的代码来显示给定lat-lon值的图像,但它给出了错误 NSString*lat=latitude; NSString*longi=longitude; mapView = [[MKMapView alloc] initWithFrame:self.view.bounds]; mapView.mapType = MKMapTypeHybrid;mapView.mapType=MKMapTypeHybrid; double _lat = [lat doubleValue]; dou
NSString*lat=latitude;
NSString*longi=longitude;
mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
mapView.mapType = MKMapTypeHybrid;mapView.mapType=MKMapTypeHybrid;
double _lat = [lat doubleValue];
double _lng = [longi doubleValue];
CLLocationCoordinate2D coord = (CLLocationCoordinate2D){_lat, _lng};
MKCoordinateSpan span = (MKCoordinateSpan){0.2, 0.2};
MKCoordinateRegion region = (MKCoordinateRegion){coord, span};
[mapView setRegion:region];
[self.view addSubview:mapView];
几个问题:
出现第一行代码后应用程序崩溃