Re: Prevent Asynchronous operation of beginSheetModalForWindow
Re: Prevent Asynchronous operation of beginSheetModalForWindow
- Subject: Re: Prevent Asynchronous operation of beginSheetModalForWindow
- From: Graham Cox <email@hidden>
- Date: Fri, 27 Jun 2008 11:22:29 +1000
On 27 Jun 2008, at 12:19 am, John Love wrote:
Still pouring over your thesis
I thought it was getting a bit damp around here... ;-)
and at the very top:
@implementation CalculateSheetController
id *mFileSheetDelegate;
Within the implementation of showSheetOnParentWindow, I get
"assignment from
incompatible pointer type" with:
id already is a pointer, so you don't want the *
and later on within this SC's implementation:
- (void) sheetDidEnd:(NSWindow*)sheet
returnCode:(int)returnCode
contextInfo:(void*)contextInfo {
[mFileSheetDelegate doSheetSelection:sheet returnCode:returnCode
contextInfo:contextInfo];
Looking much better, but one question: why are you passing <sheet> to
your FC? Why on earth does it need it? Again this exposes UI
implementation details to an unrelated controller that shouldn't need
to care about that.
By the way my FC has the formal
doSheetSelection:returnCode:contextInfo
selector or method .. one final thing on this item, I do not really
understand "informal protocols", so I have not yet tried to
implement such.
Well, you could try searching the docs for that phrase...
But in simple terms an informal protocol is just a method or methods
that different objects agree between themselves will be how they
communicate (and by 'agree between themselves' I mean that you, the
programmer, made that decision). In fact you are using them all the
time whenever you write any method that another object calls. Don't be
too misled by the jargon, there's not much more to it than that. A
*formal* protocol on the other hand, is much stricter, and uses the
@protocol directive, but I won't get into that, you probably don't
need to know. The term 'informal' is really there to distinguish it
from a formal @protocol situation.
cheers, Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden