Re: NSOutlineView autosaving of expanded/collapsed state
Re: NSOutlineView autosaving of expanded/collapsed state
- Subject: Re: NSOutlineView autosaving of expanded/collapsed state
- From: "I. Savant" <email@hidden>
- Date: Sun, 24 Feb 2008 19:07:47 -0500
Couldn't you return [[aManagedObject objectID] URIRepresentation] in
outlineView:persistentObjectForItem: to save the expanded state.
Then restore it by returning [aManagedObjectContext objectWithID:
[aPersistentStoreCoordinator
managedObjectIDForURIRepresentation:URI]] from
outlineView:itemForPersistentObject:?
You can't rely on the the URI representation the way you might
expect for any objects that haven't yet been saved. The
URIRepresentation is based on the objectID. From the documentation:
"If the receiver has not yet been saved, the object ID is a temporary
value that will change when the object is saved."
It's best to add an "expanded" attribute or something similarly
named and rely on it instead.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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