-
8 votesanswersviews
检测关闭按钮单击NSUserNotification
我在OS X上显示一个本地NSUserNotification,代码如下: NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle:@"Some Title"]; [notification setHasActionButton:YES]; [not... -
1 votesanswersviews
设置自定义时间,显示NSUserNotification
我通过以下方式创建 NSUSerNotification : NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle:notificationTitle]; [notification setInformativeText:_informativeText]; [not... -
3 votesanswersviews
如何更新已发送的NSUserNotification中的字幕?
我'm trying to update the string in the subtitle of a delivered notification (alert), I'用这样做_2618429这样做: [NSTimer scheduledTimerWithTimeInterval:5.0 target:self ... -
5 votesanswersviews
单击显示NSUserNotification additionalActions
在上图中,您可以在OS X上看到两个通知 . 第一个来自我的应用程序,第二个来自Apple的Reminders.app . 在图像中,您可以看到 otherButtonTitle 'Complete'和 actionButtonTitle 'Later' . 第二个通知,即来自Reminders.app的通知,表现完全不同 . 它会使鼠标指向下方的这个小箭头指示单击时有更多操作 . 事实上,... -
3 votesanswersviews
NSUserNotification关闭调用didActivateNotification
自从MacOS 10.13每次我点击 NSUserNotification 上的关闭按钮后,它调用: - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification 如何防止这种情况或处理 close 与 ac... -
1 votesanswersviews
ObjectiveC - 如何使用NSUserNotification标识符属性
根据苹果文档https://developer.apple.com/reference/foundation/nsusernotification/1416410-identifier NSUserNotification有一个名为identifier的属性,当标识符与另一个通知相同时,可以替换通知 . 当我测试此功能时,似乎通知没有真正替换,只是没有发送 . 如果通知中心只有一种类型的通知,但最... -
0 votesanswersviews
Apple 's docs for UNNotificationRequest'的标识符错了吗?
至于 identifier ,documentation说: 请求的唯一标识符(如果标识符不唯一,则不传递通知) . 您可以稍后使用此标识符取消仍处于待处理状态的请求 . 此参数不得为零 . 它没有交付's says it' . 但是根据here并且根据我自己的验证它确实已经发送,但它重写了使用该标识符发送的先前通知 . 所以我猜测苹果文档应该说: 如果标识符相同,则仅更新先前发送的通知 ....