Hi
According this: link text
The Mkmapview has to be the default receiver of the events.
So I change the class of my main window to MyMainWindow:
MyMainWindow.h
#import <Foundation/Foundation.h>
@class TouchListener;
@interface MyMainWindow : UIWindow {
TouchListener *Touch;
}
@end
MyMainWindow.m
#import "MyMainWindow.h"
@implementation MyMainWindow
- (void)sendEvent:(UIEvent*)event {
[super sendEvent:event];
[Touch sendEvent:event];
}
@end
TouchListener.h
#import <Foundation/Foundation.h>
@interface TouchListener : UIView {
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
@end
TouchListeners.m
#import "TouchListener.h"
@implementation TouchListener
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
return self;
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"Moved");
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Touch Began");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Touch Ended");
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Touch Cancel");
}
@end
Did I miss something?
Thanks for help