小编Pro*_*mus的帖子

为什么OSX中今天小部件的名称总是"Widget"?

我正在学习今天的OSX扩展小部件编程(目前不是iOS).我正在尝试开发一个日历小部件作为练习.

但是通知中心中小部件的标题或名称始终是"小部件"而不是我设置的.

我在所有位置的InfoPlist.strings中更改了"CFBundleDisplayName"的值(目前只有Base和Simplified Chinese).

InfoPlist.strings(Base)

/* Display name and description for this extension. */
"CFBundleDisplayName" = "This Month";
"com.apple.notificationcenter.widget.description" = "Show calendar for this month";
Run Code Online (Sandbox Code Playgroud)

InfoPlist.strings(简体中文)

/* Display name and description for this extension. */
"CFBundleDisplayName" = "??";
"com.apple.notificationcenter.widget.description" = "??????";
Run Code Online (Sandbox Code Playgroud)

另外,我更改了Widget组中Info.plist中"Bundle display name"的值,编译目标是Widget.

当我在Widget模拟器中测试小部件时,它的名称是我在InfoPlist.strings中设置的.但是当我编译(甚至清理和编译)并运行整个应用程序,然后打开通知中心时,我的新小部件的名称总是"Widget".

根据指南(https://developer.apple.com/library/mac/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW6),小部件的名称应该在InfoPlist.strings中设置,并且没有提到其他地方.

我错过了一些重要的设置文件或代码有什么问题吗?

代码可以在https://github.com/programus/this-month中找到

cocoa notificationcenter xcode6 osx-yosemite today-extension

4
推荐指数
1
解决办法
949
查看次数