opening an old document without a file
opening an old document without a file
- Subject: opening an old document without a file
- From: Victor Ng <email@hidden>
- Date: Thu, 21 Nov 2002 13:24:56 -0500
Hi,
I've got a small problem where my application 'works', but is a little
ugly.
My application resembles the Mail.app where I have a main window to
view all my old entries and a regular document window. My problem is
that I want to save/load my entries into my own persistent storage, and
I want to popup the document window to edit old entries.
Because I'm not storing entries one a 1-1 basis with files, and I'm not
using URLs, my current solution is like the code at the bottom.
My problem is that my document view is showing my default data for a
split second before the view is refreshed. It seems like there should
be a way for me to do something like :
[docController openDocumentWith
Data:myNSDataObject];
or something like that. Is my current solution 'ok' or is there some
better way for me to do this?
vic
-- code snippet below--
-(IBAction)edit:(id)sender
{
NSDocumentController *dc = [NSDocumentController
sharedDocumentController];
// open a new document
[dc newDocument:self];
// the new document will be the foreground document
MyDocument *doc = [dc currentDocument];
MyEntry *entry = <object deserialization goes here>
[doc setMyEntry:entry];
[doc updateUI];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.