Dear list,
I'm investigating getting the new 10.7 Versions stuff working on my
NSPersistentDocument app. In doing that, I've seen a couple of strange things
which I wanted to check on.
Firstly, all I've done to make it work is to return YES from +autosavesInPlace.
Now, what I notice is the following sequence of events:
1) App starts:
windowControllerDidLoadNib <NSWindow: 0x10055d970>
2) Enter Versions browser
NSDocumentRevisionsDebugMode=YES
<Error>: kCGErrorFailure: CGSDisplayID: App trying to enumerate [0 to
CGSGetNumberOfDisplays()] instead of using CGSGetDisplayList(). Compensating...
<Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to
catch errors as they are logged.
windowControllerDidLoadNib <NSWindow: 0x1091939c0>
Entered Versions: NSConcreteNotification 0x108658620 {name =
NSWindowDidEnterVersionBrowserNotification; object = <NSWindow: 0x10055d970>}
3) Exit Versions (by clicking Done button in Versions browser)
Window will close <NSWindow: 0x1091939c0> / <NSWindow: 0x1091939c0>
Open windows 1 (logged in windowWillClose:)
Exited Versions: NSConcreteNotification 0x1091a22c0 {name =
NSWindowDidExitVersionBrowserNotification; object = <NSWindow: 0x10055d970>}
4) Exit App
Window will close <NSWindow: 0x10055d970> / <NSWindow: 0x10055d970>
Open windows 1 (logged in windowWillClose:)
Some questions:
a) Why is it that I don't have 2 open windows in step 3)?
b) What is the first window doing while the Versions browser is open? It seems
the same document is opened again, judging by the NSWindow objects.
c) What are the Errors reported just after entering Versions?
Perhaps I'm not understanding how this stuff works yet, so any enlightenment
would be gratefully received.
As a side question, where are the different versions of the document kept? I've
read that they are kept in the document, but inspection of the (XML-based) Core
Data document shows that's not the case. The app is actually a manager of other
(text) files on disk, and I'm amazed to see that the versions actually reflect
the state of the managed text files, even though the save core data document
does not store the file contents. The file contents are stored temporarily in a
core data entity as a transient property. Can I then conclude that these
transient properties are stored in the different versions? I've tried reading
through the documentation on this, and I've watched the WWDC11 session on this,
but perhaps I need to do that again.
Best wishes,
Martin
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]