Frage

I have NSUserNotification working in my application. For some reason I get the generic icon image on the notification alert/banner instead of the application icon. The app. icon has been properly added. It builds fine and the icon is displayed on the About Panel.

What do I need to do to replace the notification's generic icon with the app. icon?

Thanks.

NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"Operation Successful";
notification.informativeText = @"Image Processing Complete ...";


[[NSUserNotificationCenter defaultUserNotificationCenter]deliverNotification:notification]; 


- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification{
return YES;

}

War es hilfreich?

Lösung

Could be an intermittent thing where the OS doesn't yet recognize your apps icon - it can take some time for Finder (at least did in the past..)

Have you ever installed you app in the OS or at least copied the app icon to your desktop or applications folder?

From experience that triggered Finder/the OS to update its internal caches (or whatever..) and the icon started to show up properly in the dock, etc. - and probably Notification Center.

If all fails try some cache cleaner util like Onyx or logging out and back in, all of which might just trigger the OS to properly recognize your (new) apps icon.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top