Re: Using Alert Sheets for multiple methods
Re: Using Alert Sheets for multiple methods
- Subject: Re: Using Alert Sheets for multiple methods
- From: Fritz Anderson <email@hidden>
- Date: Tue, 4 May 2004 10:35:41 -0500
ContextInfo can be anything you like. You set it at the same time you
supply the callback selector and delegate. For instance, it's the last
parameter in NSApplication's
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:,
and is the next-to-last nonvar argument in the NSBegin...AlertSheet
functions.
So set contextInfo to whatever will suit your purposes for identifying
the source.
-- F
On 4 May 2004, at 10:08 AM, Frederick C. Lee wrote:
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 {
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.
_______________________________________________
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.