NSUserNotification
非常に閉鎖的なシステムであることについては骨の折れるものではありません。ただし、プライベート API の市場にいる場合は、NSConcreteUserNotification
と呼ばれるメソッドを実装しset_identityImage:
ます。有効な NSImage を渡すと、提示された通知はそのコンテンツをその iTunes バナーとまったく同じようにレイアウトします。
@interface NSUserNotification (CFIPrivate)
- (void)set_identityImage:(NSImage *)image;
@end
- (void)applicationDidFinishLaunching:(NSNotification *)notif {
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"Some Title";
notification.subtitle = @"Some subtitle";
[notification set_identityImage:[NSImage imageNamed:@"CF_Logo.png"]];
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
}
