Re: Newbie: Strange problem with NSTableView, check boxes and Core Data
Re: Newbie: Strange problem with NSTableView, check boxes and Core Data
- Subject: Re: Newbie: Strange problem with NSTableView, check boxes and Core Data
- From: Corbin Dunn <email@hidden>
- Date: Mon, 29 Sep 2008 16:36:50 -0700
On Sep 29, 2008, at 10:55 AM, Jonathan Oddie wrote:
Hi all,
I'm new on this list -- teaching myself Cocoa programming by writing
a small utility as a Core Data document-based application. Mostly I
have everything working well, but there is one strange bug I can't
isolate where a check box in a table view sometimes fails to draw
itself properly. This happens maybe one time out of ten. Details:
- I have a Core Data entity with properties "Name" (a string) and
"Enabled" (a bool). Both are non-optional and have default values
"New" and YES, respectively.
- In my document NIB file I have an array controller set to manage
that entity. It is set to "prepare content" and "editable".
- also in the NIB, a table view with two columns: one of checkboxes,
bound to the "Enabled" property through the array controller, and
one of text fields bound to the "Name"
- an IBAction method, linked to a "new" button, which creates a new
instance of the entity with the NSEntityDescription
insertNewObjectForEntityForName:inManagedObjectContext: method
- This is a garbage-collected project.
The new document is created with no instances of the entity. When
clicking the "new" button, 9 times out of 10 everything seems fine.
When it goes wrong, either the checkbox for the newly inserted
entity doesn't draw at all, or it lacks the checkmark or the
highlight or some other visual element. There is a console message
like:
2008-09-29 11:32:56.955 IU Organ Utility v2[12568:10b] *** -
[CIFilterClassDescription _feImage]: unrecognized selector sent to
instance 0x10d32a0
2008-09-29 11:32:56.956 IU Organ Utility v2[12568:10b] Exception ***
-[CIFilterClassDescription _feImage]: unrecognized selector sent to
instance 0x10d32a0
Sometimes the class is _NSCFNumber or CIFilterShape instead of
CIFilterClassDescription. Sometimes there's no message, but the app
crashes with an EXC_BAD_ACCESS; and sometimes there's instead a
message about free() which says something about a reference count
underrun (sorry, I've been trying to repeat it while writing this
and haven't managed to).
Anyone have any ideas?
Add a breakpoint on objc_exception_throw, and debug that app. Get a
backtrace for when the exception is thrown. That may help you. See:
http://www.corbinstreehouse.com/blog/index.php/2008/08/your-most-important-breakpoint-in-cocoa/
corbin
_______________________________________________
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