2012-01-30 3 views

ответ

2

сделать подкласс UIApplication, который переопределяет sendEvent: метод:

@interface MyApplication : UIApplication 
@end 

@implementation MyApplication 

- (void)sendEvent:(UIEvent *)event { 
    if (event.type == UIEventTypeTouches) { 
     NSLog(@"Touch event: %@", event); 
    } 
    [super sendEvent:event]; 
} 

@end 

Сквозное название этого подкласса UIApplicationMain в main.m:

#import <UIKit/UIKit.h> 
#import "AppDelegate.h" 
#import "MyApplication.h" 

int main(int argc, char *argv[]) 
{ 
    @autoreleasepool { 
     return UIApplicationMain(argc, argv, 
      NSStringFromClass([MyApplication class]), 
      NSStringFromClass([AppDelegate class])); 
    } 
} 
Смежные вопросы