Inserting into NSArrayController
Inserting into NSArrayController
- Subject: Inserting into NSArrayController
- From: Jeff LaMarche <email@hidden>
- Date: Mon, 27 Jun 2005 19:16:37 -0400
I've got an NSArrayController that's bound to a Core Data entity.
It is set to "Selects inserted objects", which works fine when I bind
a control to the array controller's add: action.
However, if I add an entity using NSEntityDescription's
insertNewObjectForEntityName:inManagedContext: it doesn't select the
newly inserted object.
I've tried doing it manually, like so:
NSArray *array = [NSArray arrayWithObject:newObject];
BOOL worked = [theController setSelectedObjects:array];
worked comes back as YES, but it doesn't select the newly inserted
object. I've checked my bindings and connections in IB and they all
look good. Anyone know what might be going on here?
I guess I could use the array controller's add: method and then
retrieve a reference to the new object, which will work, but I'd like
to know why this isn't working if anyone can help me out.
Thanks,
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden