【发布时间】:2015-07-08 17:20:02
【问题描述】:
我的 Mac 应用程序会在特定时间更新它的徽章编号。
这是我的功能:
- (void)setBadgeNumber
{
// Sets the badge number to 1.
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:@"1"];
// Sends a notification.
NSUserNotificationCenter *nc = [NSUserNotificationCenter defaultUserNotificationCenter];
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"Update";
notification.informativeText = @"There's something new in the app!";
[nc deliverNotification:notification];
}
我想知道您是否可以在某个日期(例如:08-08-2015)执行此功能。
即使应用程序未运行(即使应用程序正在运行)。
有人知道您是否可以在某个日期(和时间)执行方法吗?
【问题讨论】:
-
Mac OS X 10.8+:Local Notifications
标签: objective-c macos cocoa badge