• 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
Using Alert Sheets for multiple methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Alert Sheets for multiple methods


  • Subject: Using Alert Sheets for multiple methods
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Tue, 4 May 2004 08:08:35 -0700

Greetings;
I'm trying to re-use alert-sheet code for multiple methods. I've got
it working with one method as follows:

--------------
- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
contextInfo:(void *)contextInfo {

if (returnCode == NSAlertFirstButtonReturn) {

[self saveData];

}
[[alert window] orderOut:alert];
return;

}

-------------

I'm assuming that the 'contextInfo' parameter determines the source of
the sheet. How is this implemented? It looks like a standard
procedure but I don't know how to use it to differentiate the source of
the call; and hence, what routine to branch to via the context.

Thanks in advance!

Ric.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Using Alert Sheets for multiple methods
      • From: Larry Fransson <email@hidden>
    • Re: Using Alert Sheets for multiple methods
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Lost Main Menu
  • Next by Date: Re: NSOpenPanel Oddity
  • Previous by thread: Re: Lost Main Menu
  • Next by thread: Re: Using Alert Sheets for multiple methods
  • Index(es):
    • Date
    • Thread