NSAlert runModal returning -1002
NSAlert runModal returning -1002
- Subject: NSAlert runModal returning -1002
- From: Dustin <email@hidden>
- Date: Sun, 23 Dec 2007 04:09:04 +0800
I'm using NSAlert like so:
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText:@"Some text"];
[alert addButtonWithTitle:@"Yes"];
[alert addButtonWithTitle:@"No"];
NSInteger foo = [alert runModal];
NSLog(@"Runmodal returns: %i", foo);
Usually I get the expected return code (1000 for the default "Yes"
button and 1001 for "No", as described in the documentation for
NSAlert). However, if I run this same code when a modal sheet is open,
I sometimes get a return code of -1002 (yes, negative) no matter which
button is pressed. Sometimes I get the correct return code, though.
Any idea why this might happen?
Thanks,
Dustin
_______________________________________________
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