如何使扩展坞重新加载所有扩展坞磁贴插件?
我正在制作一个使用停靠图块插件的应用程序。但是,当我重新编译我的扩展坞图块插件时,扩展坞仍然使用旧的插件,即使我 killall
扩展坞也是如此。解决此问题的唯一方法是重新启动我的 Mac,但我不想为我所做的每一个小代码更改都重新启动它。此外,码头图块插件的记录很少。谁能帮助我吗?
I am making an application which uses a dock tile plug-in. However, when I recompile my dock tile plugin, the dock still uses the old one, even when I killall
the dock. The only way to fix this is by rebooting my Mac, but I don't want to reboot it for every little code change I make. Also, dock tile plugins are poorly documented. Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用 NSAlert 和 Accessability Inspector 发现一个名为 SystemUIServer 的进程负责停靠图块插件。只需执行以下操作即可:
这将重新启动 SystemUIServer 并重新加载停靠图块插件。
I found out using an NSAlert and Accessability Inspector that a process called SystemUIServer is responsible for dock tile plugins. Just do:
This will restart SystemUIServer and reload the dock tile plugins.
您也可以在“活动监视器”中执行此操作。搜索“dock”并手动强制退出 com.apple.dock.extra。这是上面“键盘”选项的“鼠标”替代方案,并且不会造成那么多附带损害。
我建议在开发过程中,对于频繁的代码更改,您可以将上述命令包装在 Cocoa 任务中:
将其放入 NSApplication 的类别中,像这样执行:
OR(推荐)
You can also do this in "Activity Monitor". Search for "dock" and force quit com.apple.dock.extra manually. This is the "mouse" alternative to the "keyboard" option above, and it doesn't do as much collateral damage.
I'd suggest that during development, for frequent code changes, you could wrap the above command in a Cocoa task:
Put this in a category on NSApplication, executed like so:
OR (recommended)
我最近一直在与这个问题作斗争,似乎杀死 Dock 进程或 SystemUIServer 进程本身都没有成功;我不得不杀了他们两个。
回到苹果关于这个主题的文档:
我发现,如果你从字面上理解苹果文档中的“并退出”,这些插件不会徘徊,卸载也很干净。不过,我觉得这样做有点肮脏(并已就此向苹果提交了反馈),因为我相信我的 exit(0) 也会导致其他应用程序的docktileplugins也被重新加载。 (我想必须诉诸于killall Dock/SystemUIServer 也会做同样的事情)
文档似乎也含糊不清...不知道为什么Apple 会希望你做良好的内存管理工作并在你做的下一件事是终止进程时释放对象。
I have been battling with this recently, and it seems neither killing the Dock process or SystemUIServer process by themselves did the trick; I was having to kill them both.
Back to Apple's documentation on this subject:
I've found that if you take the "and exit" from Apple's docs literally, these plugins don't linger around and unloading is clean. I feel a bit dirty doing this though (and have submitted feedback to Apple on this) because I believe my exit(0) is causing other apps' docktileplugins to be reloaded too. (I guess having to resort to killall Dock/SystemUIServer does the same)
The docs seem ambiguous too... Not sure why Apple would want you doing good memory management stuff and releasing objects when the next thing you do is kill the process.