I'm trying to update the string in the subtitle of a delivered notification (alert), I'm doing it with an NSTimer
like this:
[NSTimer scheduledTimerWithTimeInterval:5.0
target:self
selector:@selector(updateSubtitle)
userInfo:nil
repeats:YES];
- (void)updateSubtitle
{
[[NSUserNotificationCenter defaultUserNotificationCenter].deliveredNotifications
enumerateObjectsUsingBlock:^(NSUserNotification *notification, NSUInteger idx, BOOL *stop) {
notification.subtitle = @"new subtitle";
}];
}
The code is executing correctly every 5 seconds. But the shown subtitle in the notification alert does not change.
Is there some way to force a "redraw" like setNeedsDisplay
or something similar?
Thanks.