Re: beginSheet
Re: beginSheet
- Subject: Re: beginSheet
- From: Keary Suska <email@hidden>
- Date: Thu, 25 May 2006 09:34:45 -0600
on 5/25/06 6:16 AM, email@hidden purportedly said:
> My purpose is to display a sheet dialog (something like the SavePanel).
> I create a MyPanel object like this:
>
> <snip>
>
> It looks me more practical to put it all in a panel object, but before I
> put beginSheet and handlePanelActions in a MyWindowController, which
> loads the panel from the nib file.
> In an earlier version I put it all in the object interface (I mean
> without @implementation MyPanel (MyPanelRuntime). In any case I' not
> sure of the label MyPanelRuntime).
> I call beginSheet from another window's view.
> Anyway it doesn't work: it stops after created and displayed the sheet
> returning with "error 11 (SIGSEGV)" or "signal 10 (SIGBUS)".
> Can anybody tell me what happens?
I don't mean to be critical but you shouldn't expected list members to debug
your code. Have you run the debugger to see exactly where the error is
occurring? You may get the answer--or at least a better idea where it's
happening--yourself.
Other than that, there are some general considerations (mostly looking at
beginSheet:). If the documentation doesn't indicate that a parameter is
optional (and you don't override that method), don't send a nil value.
contextInfo parameters that you don't use should be NULL instead of
nil--these are not the same thing. AFAIK, you can't pass nil as a value of
type SEL. I imagine you should have seen a number of compiler warnings (or,
if you didn't, warnings may be turned off).
Lastly, I don't recommend putting all of your sheet handling (raise/end/etc)
into a panel subclass. It is better, more extensible, and far more readable
to use a controller class--either one you already have or a new one (*not* a
windowcontroller subclass--that is not for sheets).
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >beginSheet (From: Livio <email@hidden>) |