2012-01-30 4 views

답변

2

sendEvent: 방법 오버라이드 (override) UIApplication의 서브 클래스 확인 :

@interface MyApplication : UIApplication 
@end 

@implementation MyApplication 

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

@end 

main.mUIApplicationMain이 서브 클래스의 이름을 전달합니다

#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])); 
    } 
} 
관련 문제