• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSArrayController select inserted object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Can't get clicking/selecting to work correctly in custom cell in NSOutlineView
  • Next by Date: Re: Possible OT, q>re crypto and cocoa (DES)
  • Previous by thread: Can't get clicking/selecting to work correctly in custom cell in NSOutlineView
  • Next by thread: Re: Possible OT, q>re crypto and cocoa (DES)
  • Index(es):
    • Date
    • Thread