On Jan 10, 2010, at 2:01 PM, cocoa-dev-requ...@lists.apple.com wrote:

> From: Jenny M <safflo...@gmail.com>
> Subject: Custom sheet question - which variable?
> To: cocoa-dev@lists.apple.com
> Message-ID:
>       <a9653e641001091840u374008f5v3c4de5d8d519b...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi, I have what may seem like a very stupid question about custom sheets. I
> am following this Apple dev tutorial:
> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCustomSheets.html
> 
> and I'm looking at this piece of code here:
> 
> if (!myCustomSheet)
>    //Check the myCustomSheet instance variable to make sure the custom
> sheet does not already exist.
>    [NSBundle loadNibNamed: @"MyCustomSheet" owner: self];
> 
> But, I have no idea what "myCustomSheet" is referring to. I know that
> "MyCustomSheet" is the separate XIB file, but of what variable type is
> "myCustomSheet"? Do I need to define and connect to it in the new XIB?
> 
> Thanks.

In this case the documentation is just putting in a quick simple check to 
verify that the sheet is not already displayed before trying to display it.
Since no variable for the sheet is passed to the method, this might seem a 
little strange... the docs here fail to remind you that you should declare 
mySheet (or whatever you want to call it) in your controller you use this in.

(the docs make an assumption that you know this here, but arguably they should 
not. You might consider filing a bug on the documentation to clarify 
it)_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to