• 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
dismissing one sheet for another problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dismissing one sheet for another problem


  • Subject: dismissing one sheet for another problem
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 18 Jan 2005 05:08:37 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

I have an app where I present the user with a sheet to
confirm settings before sending the data to my
database. My backend has a unique constraint on a
column and if the user violates this the transaction
is rolled back.

In my method to dismiss the first sheet I have:

    if ([self
sendInvoiceDataToDatabase:workingInvoice]) {

	NSLog(@"everything was beautiful so clear the inputs
and issue no warning");
 	[NSApp stopModal];
    } else {
	NSLog(@"NFG");

	[acceptThisInvoice orderOut:nil];
	[NSApp endSheet:acceptThisInvoice returnCode:0];

	NSAlert *alert = [[[NSAlert alloc] init]
autorelease];
	[alert addButtonWithTitle:@"OK"];
	[alert setMessageText:@"The invoice did not get
entered. Check your invoice number and try again.'"];
	[alert setAlertStyle:NSWarningAlertStyle];
	[alert beginSheetModalForWindow:mainWindow
modalDelegate:self didEndSelector:nil
contextInfo:nil];
    }
The first sheet dismisses and the second
(NSWarningAlertStyle) comes up. However the OK button
does not work. I am using this same code elsewhere
(but not directly after dismissing a different sheet)
and it works just fine.

Any ideas? I tried replacing the endSheet with [NSApp
stopModal]; and it is the same.

More info. Since the OK button was 'selected' I tried
typing a return and lo and behold the warning sheet
dismissed however the app was left in an unresponsive
state. Nothing works, all the menus are greyed out.

Ted




__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: dismissing one sheet for another problem
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Can I subclass text field in NSForm? Drawing 3D rectangle
  • Next by Date: Re: how to save and restore the file in cvs, with original information?
  • Previous by thread: Re: Can I subclass text field in NSForm? Drawing 3D rectangle
  • Next by thread: Re: dismissing one sheet for another problem
  • Index(es):
    • Date
    • Thread