我创建了一个UIMapView
并设置了委托,但它并没有被称为mapview的委托。
#import <MapKit/MapKit.h>
@interface MapViewController : UIView <MKMapViewDelegate>
- (id)initWith_Latitude:(NSString *)Latitude Longitude:(NSString *)Longitude;
- (id)initWith_Latitude:(NSString *)Latitude Longitude:(NSString *)Longitude
{
CGRect frame = CGRectMake(0, 0, 200, 200);
self = [super initWithFrame:frame];
if (self) {
// Initialization code
mapView = [[MKMapView alloc] initWithFrame:frame];
MKCoordinateRegion mapRegion;
[mapView setUserInteractionEnabled:YES];
[mapView setDelegate:self];
mapRegion.center.latitude = [Latitude doubleValue];
mapRegion.center.longitude = [Longitude doubleValue];
mapRegion.span.latitudeDelta = 0.005;
mapRegion.span.longitudeDelta = 0.005;
mapView.region = mapRegion;
[self addSubview:mapView];
}
return self;
}
不调用委托:
- (void)mapViewDidFinishRenderingMap:(MKMapView *)mapView2 fullyRendered:(BOOL)fullyRendered{
NSLog(@"abc...");
}
如何解决这个问题,请帮助我。