多个仪表板小部件实例无法在小部件更新中幸免。有什么办法可以防止这种情况? [英] Multiple Dashboard widget instances don't survive widget update. Any way to prevent this?

查看:90
本文介绍了多个仪表板小部件实例无法在小部件更新中幸免。有什么办法可以防止这种情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个Mac OS X仪表板,以显示您自己和其他人的StackOverflow天赋。



我的问题是,每当我将该小部件更新为新版本时,版本,将删除所有以前的实例,并在仪表板上创建一个新实例。因此,如果您以前有4个人的风格,则必须重新创建小部件并再次输入其用户ID。 :(



在更新小部件时有什么方法可以保留所有正在运行的实例吗?



检查首选项文件,我看到在部署新版本的小部件之后创建了一个新实例,这是设计使然吗?所有小部件是否有可能像这样工作?如果是这样,可以手动进行吗?



您可以在

(来源: junecloud.com


I've written a Mac OS X Dashboard to show the StackOverflow flair of yourself and other people.

My problem is that whenever I update that widget to a new version, all previous instances are removed and a single new instance is created on the Dashboard. So if you previously followed the flair of 4 people you'll have to recreate the widgets and enter their user-IDs again. :(

Is there any way to keep all running instances while updating a widget?

Checking the preferences file, I see that a new instance is created after a new version of the widget is deployed. Is this by design? Does all widgets work like this, by any chance?? If so, can this be manually circumvented somehow?

You can find the widget in question, including the project files, at http://widget.huxhorn.de

I've changed the code in remove() to set the preferences to the correct values instead of null as suggested below - but this doesn't help, either.
What's my mistake?? Help! I'm stuck!


The other problem of my widget has been fixed:
I accidentally called

widget.preferenceForKey(null, dashcode.createInstancePreferenceKey(userIdPrefKey));

instead of

widget.preferenceForKey(dashcode.createInstancePreferenceKey(userIdPrefKey));

but this is now fixed (not yet released).

解决方案

I know about this tool that takes over the install process: http://junecloud.com/software/mac/smart-widget-installer.html


(source: junecloud.com)

这篇关于多个仪表板小部件实例无法在小部件更新中幸免。有什么办法可以防止这种情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆