• 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
Inserting into NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Inserting into NSArrayController
      • From: Joshua Scott Emmons <email@hidden>
  • Prev by Date: Re: NSScrollView and Custom Views
  • Next by Date: Re: Convert PICT to NSImage
  • Previous by thread: Predicate on two values
  • Next by thread: Re: Inserting into NSArrayController
  • Index(es):
    • Date
    • Thread