• 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
sheetDidDismiss selector no good from NSBeginAlertSheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sheetDidDismiss selector no good from NSBeginAlertSheet


  • Subject: sheetDidDismiss selector no good from NSBeginAlertSheet
  • From: Andrew Taylor <email@hidden>
  • Date: Wed, 22 Sep 2004 12:23:09 -0400

Title: sheetDidDismiss selector no good from NSBeginAlertSheet
Hi,

I am trying to detect when an alert sheet presented by NSBeginAlertSheet has been dismissed, and then do stuff afterwards. Using Xcode 1.5 and X 10.3.5 on a 1ghz Powerbook.

So, trying the obvious I provided a selector for the didDismiss argument.
No joy.

Here is what shows up in the console window after I run the included code:

2004-09-22 12:14:00.525 test[1472] called sheetgone
2004-09-22 12:14:00.527 test[1472] *** -[MyWindow itsgone:]: selector not recognized
2004-09-22 12:14:00.529 test[1472] *** -[MyWindow itsgone:]: selector not recognized


So what should be the prototype for the didDismiss selector if it is not what the documentation and header file says?

Or is there something else I am doing wrong?

thanks.


#import "MyWindow.h"

@implementation MyWindow

- (
void)displayErrorMessage:(NSString *)error dismiss:(SEL) didDismiss
{
    NSBeginAlertSheet(
       
@"Error",
       
@"OK",
       
nil,
       
nil,
       
self,
       
self,
       
nil,
        didDismiss,
       
self,
        error,
       
nil);
       
}

- (
void)itsgone:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
  NSLog(
@"called itsgone");
}

- (
void)displayURLFailedError
{
        NSString *message = [NSString stringWithFormat:
@"this is a message"];
// SEL mySelector = @selector(itsgone:);
// [self displayErrorMessage:message dismiss:mySelector];
  [
self displayErrorMessage:message dismiss:@selector(itsgone:)];
}

-(
void)sheetgone:(NSNotification*)note
{
NSLog(
@"called sheetgone");
}

-(
void)handleFinishedNotification:(NSNotification*)note
{
    [
self displayURLFailedError];
}

- (
void)awakeFromNib
{
             NSNotificationCenter*nc;
                nc = [NSNotificationCenter defaultCenter];

              [nc addObserver:
self selector:@selector(handleFinishedNotification:)
                            name:NSWindowDidBecomeMainNotification object:
nil];

             [nc addObserver:
self selector:@selector(sheetgone:)
                             name:NSWindowDidEndSheetNotification object:
nil];
}

@end
 _______________________________________________
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: sheetDidDismiss selector no good from NSBeginAlertSheet
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: Newbie question: autorelease sends autorelease
  • Next by Date: Re: sheetDidDismiss selector no good from NSBeginAlertSheet
  • Previous by thread: RE: Deployment Application will not start (solved)
  • Next by thread: Re: sheetDidDismiss selector no good from NSBeginAlertSheet
  • Index(es):
    • Date
    • Thread