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