NSArrayController select inserted object
NSArrayController select inserted object
- Subject: NSArrayController select inserted object
- From: "Tony S. Wu" <email@hidden>
- Date: Thu, 3 May 2007 14:53:12 -0700
i have a code as followed to insert an object into an entity:
activity = [NSEntityDescription insertNewObjectForEntityForName:
@"Name" inManagedObjectContext: [self managedObjectContext]];
[activity setPropertValue: value];
// setting more property values
but i would like to select the object that is inserted in the
nsarraycontroller bound to that entity.
so i do this:
[dwSelectedAccountActivityArrayController setSelectedObjects:
[NSArray arrayWithObject: activity]];
but it doesn't work.
i tried to log the selection index of before and after, the selection
after is always a fixed number (something like 24348714).
i also made sure that the object is inserted and not faulted.
does anyone have any suggestions?
thanks.
Tony S. Wu
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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