NSArrayController won't "add", and "delete" removes both the record & selectable item
NSArrayController won't "add", and "delete" removes both the record & selectable item
- Subject: NSArrayController won't "add", and "delete" removes both the record & selectable item
- From: "Jon C. Munson II" <email@hidden>
- Date: Fri, 6 Feb 2009 15:44:28 -0500
- Organization: JTA Enterprises LLC
Namaste!
In my app, I have an NSArrayController bound to a Core Data entity which is
an intermediary table, tblPattern_Yarn, which is a join table between
tblPattern and tblYarn. tblPattern_Yarn has couple of qualifying fields as
well. There exists to-many relationships from tblPattern to tblPattern_Yarn
and from tblYarn to tblPattern_Yarn. relPattern and relYarn are the names
of the relationships in tblPattern_Yarn, and relPattern_Yarn is the
relationship object in tblPattern and tblYarn. The delete rule is set to
Cascade.
On my screen, I have a tableview that displays tblPattern_Yarn for the
selected pattern. I have buttons for both insertion/deletion for
tblPattern_Yarn, each hooked to add/remove (respectively) to the
NSArrayController bound to tblYarn.
Why, when I click the insertion button, is there not a new record inserted
into the NSArrayController and propagated up to the screen?
I have similar setups for a couple of other tables on the same screen.
Also, in a similar setup, I have a tableview for needles. I added a few
needles, and added them to the tblPattern_Needle. Now, when I click the
delete button, which is hooked to remove for that NSArrayController, it not
only deletes the tblPattern_Needle record, but also deletes the tblNeedle
record (which is not the desired behavior). Is this due to the Cascade
setting on the relationship?
Thanks in advance!
Peace, Love, and Light,
/s/ Jon C. Munson II
_______________________________________________
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