Newbie: Strange problem with NSTableView, check boxes and Core Data
Newbie: Strange problem with NSTableView, check boxes and Core Data
- Subject: Newbie: Strange problem with NSTableView, check boxes and Core Data
- From: Jonathan Oddie <email@hidden>
- Date: Mon, 29 Sep 2008 11:55:09 -0600
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? It seems a little similar to the "[NSCFNumber
intValue]: unrecognized selector" problem recently discussed here, but
I'm not explicitly using any threads in this app. It almost seems like
something is getting freed by the garbage collector before it's used.
Thanks for any advice about a newbie's problem,
Jonathan
_______________________________________________
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