Re: Bindings and core data
Re: Bindings and core data
- Subject: Re: Bindings and core data
- From: Michael Süssner <email@hidden>
- Date: Thu, 28 May 2009 21:46:44 +0200
Thanks for the hint
Am 28.05.2009 um 01:23 schrieb Shlok Datye:
The reason why IB complains is that the dot accessor only returns a
regular set. You should therefore use "IBOutlet NSSet
*selParticipants" instead.
For the same reason, you cannot add a participant to
selection.participants using addObjects. Instead, you should either
(1) use mutableSetValueForKey:@"participants" to get a genuine
mutable set and then add your object(s) to that set; or (2) use the
addParticipantsObject: or addParticipants: methods after properly
declaring them.
For more information, you can read the "To-many relationships"
subsection on this page:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html
Shlok Datye
Coding Turtle
http://codingturtle.com
On 27.05.2009, at 21:18, Michael Süssner wrote:
Hi
I am experimenting with core data and bindings.
I have a core data table with a one to-many relationship named
"participants"
I have in the same view another table displaying a list of
participants. I want to add additional participants using a
Popuplist with contacts and a participant is related to contacts.
So, when I have selected a contact entry, I press a button which
calls method of the PopUpMenu Controller Object, which reads the
selected Object by
vContact = [[self selectedObjects] objectAtIndex:0];
I have defined in the PopupMenu Controller Object
IBOutlet NSMutableSet *selParticipants;
which I have bound to the table.selection.participants
(I do not understand that IB complains that it is not NSMutableSet)
Then I want to add the vContact to the selection.participants using
addObjects but the table of participants displays invalid values.
I am not sure what is the mistake.
Michael
Mit freundlichem Gruß
Michael Süssner Dipl.-Ing.
Wimbergergasse 10-44
1070 Wien
Tel: +43 (1) 5268251
Mobil: +43 (676) 7955229
_______________________________________________
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