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

Re: Setting table selection at document open with Core Data?


  • Subject: Re: Setting table selection at document open with Core Data?
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 20 Feb 2007 14:11:49 -0500

Adam:

Forcing the array controller to fetch should work. Is your array controller bound to another controller? You'd probably need to tell that one to fetch first.

--
I.S.


On Feb 20, 2007, at 2:02 PM, Adam Knight wrote:

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:
40gmail.com


This email sent to email@hidden

_______________________________________________

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: Adam Knight <email@hidden>
References: 
 >Setting table selection at document open with Core Data? (From: Adam Knight <email@hidden>)

  • Prev by Date: File's Owner, NSWindowController, KVO, bindings
  • Next by Date: Re: Setting table selection at document open with Core Data?
  • Previous by thread: Setting table selection at document open with Core Data?
  • Next by thread: Re: Setting table selection at document open with Core Data?
  • Index(es):
    • Date
    • Thread