开发者

Alert for an OS X application

I have to bring up an alert when a certain event in my app has been fired.

What is the best way to do it? I can not use Growl because my app will be submitted on the Mac App Store and it does not mean that user will use Growl.

But I'd like something similar.

At best, an alert like cale开发者_运维技巧ndar events from iCal. Can anyone help me?


You mean like an NSAlert?

NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Delete the record?"];
[alert setInformativeText:@"Deleted records cannot be restored."];
[alert setAlertStyle:NSWarningAlertStyle];
[alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜