MKMapView not calling delegate methods

Posted by criscokid on Stack Overflow See other posts from Stack Overflow or by criscokid
Published on 2009-09-04T13:42:42Z Indexed on 2010/05/02 10:17 UTC
Read the original article Hit count: 312

Filed under:
|

In a UIViewController I add a MKMapView to the view controlled by the controller.

- (void)viewDidLoad {
[super viewDidLoad];
CGRect rect = CGRectMake(0, 0, 460, 320);
map = [[MKMapView alloc] initWithFrame:rect];
map.delegate = self;
[self.view addSubview:map];
 }

Later in the controller I have

- (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView
{
     NSLog(@"done.");
}

Done never gets printed. None of the other delegate methods get called either like mapView:viewForAnnotation: I use a MKMapView in an another app, but this seems to happen on any new application I make. Has anyone else seen this behavior?

EDIT:

The problem seems to be when UIViewController is made the delegate of the MKMapView, a direct subclass of NSObject seems to work okay. I can work around like this, still seems very odd since I've done it before.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about mapkit