• 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
Setting table selection at document open with Core Data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting table selection at document open with Core Data?


  • Subject: Setting table selection at document open with Core Data?
  • From: Adam Knight <email@hidden>
  • Date: Tue, 20 Feb 2007 13:02:55 -0600

I'm trying to have my document-based Core Data program remember the last selection in the NSTableView and restore it at startup with setSelectedObjects. I save the object ID URLs in a document preference and restore them perfectly fine in windowControllerDidLoadNib, so I know that Core Data has its store and so on because I can use managedObjectIDForURIRepresentation to locate the objects just fine at that point.

However, the NSArrayController that's powering the NSTableView has no content at this stage, and I don't appear to be able to force the issue by using prepareContent/fetch/rearrangeObjects or their ilk. It'll load when it wants to. However, that breaks things for me because calls to setSelectedObjects have no effect if there's no content to select.

So ... has anyone run into this one and won? I'd prefer not to use a hack, but if I have to, I have to.


Adam Knight
If you're not going to stop and appreciate the scenery, you're not going to
enjoy Myst. The same thing applies on the Mac as well. -- Rand Miller



_______________________________________________

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


  • Follow-Ups:
    • Re: Setting table selection at document open with Core Data?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Accessing @private superclass ivars
  • Next by Date: File's Owner, NSWindowController, KVO, bindings
  • Previous by thread: Re: Appropriate control for a set
  • Next by thread: Re: Setting table selection at document open with Core Data?
  • Index(es):
    • Date
    • Thread