Using Alert Sheets for multiple methods
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.