[英]how to customize wxApp to implement protocol?
I am currently using both wxWidgets
and CEF
framework to build a simple application.我目前正在使用
wxWidgets
和CEF
框架来构建一个简单的应用程序。 While trying to work out a clean quit, I figured out that CEF needs the application to implement CefAppProtocol
so that certain events can be sent back.在尝试彻底退出时,我发现 CEF 需要应用程序来实现
CefAppProtocol
以便可以发回某些事件。 Currently my code crashes with an exception [wxNSApplication isHandlingSendEvent]: unrecognized selector sent to instance 0
.目前我的代码崩溃并出现异常
[wxNSApplication isHandlingSendEvent]: unrecognized selector sent to instance 0
。 I am assuming this has to do with the wxApp
default implementation.我假设这与
wxApp
默认实现有关。 Query is how do I make sure that my instance/ class of wxApp
confirms to CefAppProtocol
?查询是如何确保我的
wxApp
实例/ class 确认到CefAppProtocol
?
wxApp
itself doesn't inherit from NSApplication
, but you should be able to override wxApp::OSXCreateAppController()
to create a custom "controller", which is used as a delegate with [NSApplication sharedApplication]
and thus should allow you to handle unknown selectors. wxApp
本身不继承自NSApplication
,但是您应该能够覆盖wxApp::OSXCreateAppController()
以创建自定义“控制器”,该控制器用作[NSApplication sharedApplication]
的委托,因此应该允许您处理未知的选择器.
However, it's the "instance 0" part of the message that looks worrisome to me -- doesn't this mean that something is nil when it shouldn't be?然而,让我担心的是消息中的“实例 0”部分——这是否意味着某些东西在不应该是 nil 的时候是 nil ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.