关于UIApplication的sendEvent方法的一个问题
我重写 UIApplication 的 - (void)sendEvent:(UIEvent *)event
方法来处理某些触摸事件。
.h
@interface myUIApplication : UIApplication {
}
.m
@implementation myUIApplication
- (void)sendEvent:(UIEvent *)event {
NSLog(@"a event catched");
[super sendEvent:event];
}
@end
,我将文件所有者的类编辑为 MainWindow.xib 中的 myUIApplication。 但当我触摸屏幕时 没有像@“捕获事件”这样的输出
我有什么错误吗?
谢谢!
I override the - (void)sendEvent:(UIEvent *)event
method of UIApplication to handle some touch event.
.h
@interface myUIApplication : UIApplication {
}
.m
@implementation myUIApplication
- (void)sendEvent:(UIEvent *)event {
NSLog(@"a event catched");
[super sendEvent:event];
}
@end
and I edit my File's Owner's class to myUIApplication in MainWindow.xib.
But when I touch the screen
There is no output like @"a event catched"
Is there some mistake I have?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将
@"myUIApplication"
传递给UIApplicationMain
函数。所以应该是这样,You will have to pass
@"myUIApplication"
toUIApplicationMain
function. So it should be,