Pro*_*mus 4 cocoa notificationcenter xcode6 osx-yosemite today-extension
我正在学习今天的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中设置,并且没有提到其他地方.
我错过了一些重要的设置文件或代码有什么问题吗?
仅供参考,我如何解决同样的问题.
将Bundle显示名称更新为您想要的任何名称
Widget/InfoPlist.strings
"CFBundleDisplayName" = "My App";
Run Code Online (Sandbox Code Playgroud)
退出XCode.
退出小部件模拟器.
进入Activity Monitor应用程序并退出Notification Center进程名称.
通知中心将使用更新的Bundle Display Name重新启动.