Re: [Solved] NSDocument with NSMatrix crasher (10.4)
Re: [Solved] NSDocument with NSMatrix crasher (10.4)
- Subject: Re: [Solved] NSDocument with NSMatrix crasher (10.4)
- From: Shehryar Khan <email@hidden>
- Date: Mon, 10 Jul 2006 16:01:17 -0700
Thank you Erik - that's a much better workaround.
The following in my NSDocument subclass did the trick.
- (void)dealloc
{
<snip>
// SK - workaround for this bug
// http://www.cocoabuilder.com/archive/message/cocoa/
2006/7/9/167168
[hoursMatrix abortEditing];
<snip>
[super dealloc];
}
-shehryar
On Jul 10, 2006, at 3:06 PM, Erik Buck wrote:
Since the bug seems related to a text filed being in edit mode at
the same time it is being deallocated, how about the following work
around:
In the document's -dealloc or -close or in any other methods that
is called after the decision to release the document is made but
before the autorelease pool is popped,
send the -abortEditing message to the matrix.
As an alternative to -abortEditing, use Apple's helpful sample code:
if ([myWindow makeFirstResponder:myWindow]) {
/* All fields are now valid; it’s safe to use
fieldEditor:forObject:
to claim the field editor. */
}
else {
/* Force first responder to resign. */
[myWindow endEditingFor:nil];
}
Matt Neuburg <email@hidden> wrote:
On Sun, 9 Jul 2006 15:28:30 -0400, Erik Buck said:
Forgive me if I don't understand the problem. I have not read the
entire thread. However...
Why was a view being being edited put in an autorelease pool and
therefore released as shown in these line of the crash stack dump ?
We don't know - that's the bug. This app has no code except for
what comes
fresh from Apple in the template. (Plus one line that apparently
has nothing
to do with the matter, though presumably it does.)
m.
--
matt neuburg, phd = email@hidden,
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
_______________________________________________
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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