• 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: EXC_BAD_ACCESS in NSTableView adding object when visible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_ACCESS in NSTableView adding object when visible


  • Subject: Re: EXC_BAD_ACCESS in NSTableView adding object when visible
  • From: Timothy Collett <email@hidden>
  • Date: Sun, 29 Jul 2007 10:54:48 -0400

On May 26, 2007, at 6:15 PM, James Bucanek wrote:

Timothy Collett <mailto:email@hidden> wrote (Saturday, May 26, 2007 11:28 AM -0400):
Greetings. I am still pretty new at Cocoa, and I am experiencing a bad
access error in an NSTableView when adding an object to its data
source while the table is visible, or on the first time attempting to
show the NSTableView after adding the object. According to the stack
view visible in the debugger window, the bad access occurs when trying
to set the value of the cell. It makes me think I've not allocated or
retained something correctly, but I'm not sure what.

This is probably an over-released object. You should be able to verify this by turning on the NSZombie options (see <http:// developer.apple.com/technotes/tn2004/tn2124.html>).


One thing to look out for with NSCell is that NSCell objects get copied constantly. They are "rubber stamps" used over and over again to draw the contents of rows, and whenever they are needed the table/outline classes make a copy of them. If you've subclassed NSCell make sure you are implementing all of the NSCopy protocols correctly. If you don't, you get two NSCells both referencing a single object with a single retain. Then one NSCell gets released and the second one blows up.

Greetings once more!

Yikes, it's really been two months...sorry it took me so long; we've been moving to our first house :-/

Anyway, I set NSZombieEnabled to YES, and got the following in my debug output when I hit the problem:
--
2007-07-29 10:31:48.368 Character Creator2[17121] *** -[_NSZombie forward::] not overridden!
--


I'm afraid I have no idea how that helps me...I set a breakpoint on [_NSZombie forward::], as was recommended to someone else with a similar problem.

Now, for some more information in answer to your assistance:
I am not subclassing NSCell, though I am subclassing NSTableView. However, I returned to a vanilla NSTableView and got exactly the same problem, as shown in the stacktrace screenshot. Also as shown in the stacktrace screenshot, there is none of my code in the stack at the time of the crash, so I really don't know which part of the code I should post to assist in diagnosing my strange problem.


If you like, though, I'll be happy to zip up the whole project and post it for some kind soul to look over...as long as said kind soul would be willing to overlook the hundreds of big programming no-nos I'm sure are in there ;-)

Once again, I thank you for any assistance that can be rendered.

Timothy Collett
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
  • Next by Date: Compress PDF
  • Previous by thread: Re: Adding a new object to NSArrayController through bindings
  • Next by thread: Compress PDF
  • Index(es):
    • Date
    • Thread