在外部单击时关闭 MAAttachedWindow(实际上是一个视图)
我有一个 MAAttachedWindow
,当单击状态栏项目时它会自动显示。当它在外部单击时,我需要将其关闭。我发现了其他一些 说明 将其设置为委托并使用 - (void)windowDidResignKey:(NSNotification *)notification
检测用户何时退出窗口。我已经尝试了很多次,但似乎无法让它工作,这可能是因为我没有正确设置委托。设置委托以响应通知的最佳方法是什么?该代码位于此处。
提前致谢
I have a MAAttachedWindow
that shows itself when a status bar item is clicked. I need to have it close when its clicked outside of. I found some other directions that say to set it as a delegate and use - (void)windowDidResignKey:(NSNotification *)notification
to detect when the user exits the window. I've tried it many times but can't seem to get it working which is probably because I didn't correctly set the delegate. Whats the best way to set the delegate so it will respond to the notification? The code is available here.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现要收到通知,您必须注册。
I found out to get the notification you have to register for it.