docs:programming:cocoa_and_objective-c:alert_box

Alert Box

(alignment is funky but it allows colons to align when pasting into Xcode)

- (void)showAlert:(NSString *)msg withTitle:(NSString *)title
{
	// autoreleased alert
	NSAlert *alert = [NSAlert alertWithMessageText:title
									 defaultButton:@"OK"
								   alternateButton:nil
									   otherButton:nil
						 informativeTextWithFormat:msg];
	[alert beginSheetModalForWindow:(NSWindow *)window
					  modalDelegate:self
					 didEndSelector:nil
						contextInfo:NULL];
}
  • docs/programming/cocoa_and_objective-c/alert_box.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1