Cocoa 将咆哮嵌入可可应用程序Iconda
我成功地在我的应用程序中实现了咆哮。我还有一个小问题 是否可以在通知中设置图标的大小(代码中的iconData)?它太小了 我的代码是:Cocoa 将咆哮嵌入可可应用程序Iconda,cocoa,growl,Cocoa,Growl,我成功地在我的应用程序中实现了咆哮。我还有一个小问题 是否可以在通知中设置图标的大小(代码中的iconData)?它太小了 我的代码是: NSBundle *myBundle = [NSBundle bundleForClass:[AppController class]]; NSString *growlPath = [[myBundle privateFrameworksPath] stringByAppendingPathComponent:@"Growl.framework"]
NSBundle *myBundle = [NSBundle bundleForClass:[AppController class]];
NSString *growlPath = [[myBundle privateFrameworksPath] stringByAppendingPathComponent:@"Growl.framework"];
NSBundle *growlBundle = [NSBundle bundleWithPath:growlPath];
if (growlBundle && [growlBundle load]) {
[GrowlApplicationBridge setGrowlDelegate:self];
[GrowlApplicationBridge notifyWithTitle:@"ALERT!!!" description:@"\n\nNonloso" notificationName:@"Hack" iconData:[[[NSImage alloc] initWithContentsOfFile:@"/Users/blabla/image.JPG"] TIFFRepresentation] priority:2 isSticky:NO clickContext:[NSDate date]];
}
如果图像本身不是太小(我不这么认为),则由活动的咆哮主题决定图像在通知中的大小。没有办法从代码中改变这一点:由用户决定要使用哪个咆哮主题