• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Solved] NSDocument with NSMatrix crasher (10.4)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: NSDocument with NSMatrix crasher (10.4) (From: Erik Buck <email@hidden>)

  • Prev by Date: Re: NSDocument with NSMatrix crasher (10.4)
  • Next by Date: [Moderator] EOT Re: [OT] OS X Icon Designers
  • Previous by thread: Re: NSDocument with NSMatrix crasher (10.4)
  • Next by thread: Coredata - undo manager and inserting objects... (unit test)
  • Index(es):
    • Date
    • Thread