I am quite new in Objective C, but learning fast. My project is quite complete and I have implemented as well classes than delegates etc etc.
I am using an MKMapView to display things on a map. I also need the user to click on Pins which will give back some informations, but I do want that the MKViewMap makes some estimations before sending info.
As such I have subclassed MKMapView, and I am using this class to display. But I don't get the delegates called. It worked normally when I was using MKViewMap in a standard way. Here is some code. The subclass has a delegate protocol, and this works perfectly
// .h file
#import < MapKit/MapKit.h >
@protocol MyMapViewDelegate < NSObject >
@required
- (void) ReturnAddressToHail:(NSString*) FullAddresse andNumber:(NSString*) FullNumber;
- (void) ReturnSelectedDriverHash:(NSString*) DriverHash;
@end
@interface MyMapViewClass : MKMapView < MKMapViewDelegate >
{
id < MyMapViewDelegate > delegate;
CLLocationCoordinate2D mapCenter;
NSDictionary *Info;
CLLocation * ClientNewLocation;
}
@property (retain) id delegate;
// .m file
#import "MyMapViewClass.h"
#import "NSObject+MapAnnotationHelper.h"
@implementation MyMapViewClass
@synthesize geoCoder;
@synthesize delegate;
self.delegate = self;
-(void) mapView:(MKMapView *) mapView regionDidChangeAnimated:(BOOL)animated
{
(void) self.updateAddress;
NSLog(@"regionchange delegate");
}
The latter is never called. Any ideas?