Re: Setting table selection at document open with Core Data?
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