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.
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.
If you open up the console window for the debugger, you can chat
directly with gdb. You can issue gdb commands to get back
traces, dump variables, etc.
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com