• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSAlert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAlert


  • Subject: NSAlert
  • From: Bart Beulen <email@hidden>
  • Date: Fri, 25 Apr 2008 21:55:04 +0200

I'm new to cocoa, I'm trying to display an alertbox. This is the code:

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: (NSWindow *)window modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil];

- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
  contextInfo:(void *)contextInfo {
NSLog(@"Test)
}

I cannot find out how to refer to the window of my single window program in the method: beginSheetModalForWindow
Some help would be appreciated!


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSAlert
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Framework for IB Plugin and app
  • Next by Date: Re: NSAlert
  • Previous by thread: [not solved] Re: Framework for IB Plugin and app
  • Next by thread: Re: NSAlert
  • Index(es):
    • Date
    • Thread