Re: _newFirstResponderAfterResigining
Re: _newFirstResponderAfterResigining
- Subject: Re: _newFirstResponderAfterResigining
- From: Keith Blount <email@hidden>
- Date: Sun, 11 Sep 2005 04:52:11 -0700 (PDT)
Many thanks for the reply. I've managed to fix the
crash in my app, now, though I've no idea why the
problem that caused it should really have been a
problem in the first place. The crash happens in the
following circumstance:
* I have a set up whereby the first responder in my
main window can be launched in a separate (full
screen) window.
* The separate window is controlled by its own window
controller.
* Upon launching the new window, I swap the first
responding view of the main window into it, then show
the window via its window controller's methods.
* Upon closing the new window, the view is restored
back into its original, main, window.
* If I then try to do the same again with a different
view, when it tries to become first responder in the
new window, I get the
_newFirstResponderAfterResigining (sic) error.
In my original set up, the window controller for the
new window was only initialised the once, when it was
first needed. It was then kept around until the
document was closed, and this same window controller
was used for every launch of the new window, just
swapping in the new first responder as required. In
this circumstance, I got the crash whenever the first
responder was changed between launches of the new
window.
When I changed it so that the window controller was
released every time the window was closed and
recreated every time it was needed, the crash went
away. (In my app, there can only be one full screen
window at any one time, hence I was using the same
window controller.)
I've put together a very small test project that shows
this problem, which can be downloaded here:
http://www.rumramruf.com/FirstResponderCrashTest.zip
I would be very grateful if someone could take a look
at it to check I'm not doing something obviously
stupid to cause the crash. If I'm not, I'll file a
bug.
I don't know if this info helps with finding your own
crashes or not.
All the best,
Keith
--- j o a r <email@hidden> wrote:
>
> On 11 sep 2005, at 01.58, Keith Blount wrote:
>
> > Does anybody know the cause of - or even better,
> the
> > cure for - the following message?
> >
> > "NSWindow: -_newFirstResponderAfterResigining is
> not a
> > valid message outside of a responder's
> implementation
> > of -resignFirstResponder."
> >
> > A couple of people in the archives have
> experienced
> > something similar, but no one has posted a
> solution. I
> > am getting this message in the following
> circumstance:
> >
> > I have a -currentView method, which returns the
> > current first responder of the window provided it
> is a
> > text view. This is used to launch a full screen
> window
> > (the text view is then removed from its current
> window
> > and placed in the full screen window, and then
> > restored when full screen ends). It seems that
> calling
> > NSWindow's -makeFirstResponder: is responsible for
> the
> > error message somewhere along the line. Debugging
> only
> > comes up with lots of private stuff.
> >
> > If anyone has any ideas, I would be very grateful.
>
> We've seen this problem associated with a number of
> crashes reported
> for our application. So far we've been unable to tie
> it to anything
> that we do, and have assumed it to be a bug in Mac
> OS X. If you could
> provide the steps required to reproduce it, or have
> more information
> on what you think is causing it, I would be
> interested to know. If
> you find out more, it would probably make sense to
> file a bug report
> to Apple, to allow them to either fix the problem,
> or update the API
> documentation to help us avoid doing whatever is
> causing it.
>
> Thanx,
>
> j o a r
>
>
>
>
______________________________________________________
Yahoo! for Good
Watch the Hurricane Katrina Shelter From The Storm concert
http://advision.webevents.yahoo.com/shelter
_______________________________________________
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