Re: Dynamically loading NIB files into sheets
Re: Dynamically loading NIB files into sheets
- Subject: Re: Dynamically loading NIB files into sheets
- From: j o a r <email@hidden>
- Date: Sun, 14 Apr 2002 23:09:44 +0200
On Sunday, April 14, 2002, at 10:42 , Sebastian Celis wrote:
// The following line is giving me compiler warnings:
// SheetController.m:35: warning: cannot find class (factory)
method.
// SheetController.m:35: warning: return type for `alloc'
defaults to id
// Why isn't it working?
Don't really know, looks wierd - why would it not find "alloc"? Could
you double-check the import statements between the two classes? Are you
sure you made SheetWindowController a subclass of NSWindowController?
You did put the method definition for "initWithWindowNibName:" in the
interface declaration too, not just in the implementation right?
You said that the SheetWindowController should have "methods added for
it to be the delegate of the sheet, etc. as outlined above." How and
why would I do this? Is this just so that I can tell when the sheet is
closing so that I can run the code that uses whatever information the
user entered into the sheet?
I assume that you display things in the sheets that you open, perhaps
user interface controls like buttons and text fields and stuff. All of
this needs to be validated and formatted, buttons need to be connected
to outlets and actions methods and finally data needs to be collected,
et.c. I though you might want to put this code in the
SheetWindowController, or at least part of it. That was what I refered
to - you probably knew that before I confused you! ;)
Also, does this have anything to do with the line:
[NSApp beginSheet...
{
...
didEndSelector:[sheetCtrl selector]
...
}
which is giving me an error?
Ah, that one - sorry! Read on...
Do I need to add a variable "selector" to the SheetWindowController
class that refers to the method that should run when the sheet closes?
It depends. If you use the same selector for all sheets then you can
hardwire it to something like this:
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
I think I only managed to confuse you by adding the other notation where
you could return a different selector for different
SheetWindowControllers - all in all rather useless. Just forget it.
Regards,
j o a r
_______________________________________________
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.