You need a subclass of UIApplication
(let's call it MyApplication
).
You modify your main.m
to use it:
return UIApplicationMain(argc, argv, @"MyApplication", @"MyApplicationDelegate");
And you override the method [MyApplication sendEvent:]
:
- (void)sendEvent:(UIEvent*)event {
//handle the event (you will probably just reset a timer)
[super sendEvent:event];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…