Re: Not-documents, but similar
Re: Not-documents, but similar
- Subject: Re: Not-documents, but similar
- From: Nathan Day <email@hidden>
- Date: Thu, 24 Feb 2005 13:19:43 +1100
On Thursday, February 24, 2005, at 11:40AM, Andrew White <email@hidden> wrote:
>
>Nathan Day wrote:
>> I would us a document based app if I was you, all you have to do is
>> remove the save and open actions. If you use the undo manager you will
>> also have to override a method to stop the document from being 'dirtied'
>> so that it will not show the bullet in the close button and show a save
>> alert when the user tries to close the window. Trying to implement all
>> of the rest of that functionality yourself is just going to be a wasted
>> effort. One of the benifits of the document base project templates is
>> all application that use that project template all behave in a consitent
>> manner.
>
>Are there any gotchas to this method? One thing I noticed was that in
>order for 'new' to work correctly, I need to have an instance of the
>correct document type and set to editor in the list of document types
>handled by the application. Which results in some odd semantics for the
>developer, because there is actually no such document type on disk, only a
>transient window.
I currently don't have internet acces from home at the moment, my modem broke, so I writting this at work on a PC, otherwise I would just open up one of my own projects to see what I do.
A new document doesn't have a representation on disk until it is actually save, all the type info does is tell you what kind of document to create. Later when saving the document that is when it is translated into a file type.
>What happens if someone tries to send a save or open apple event to my app?
Then your writeToFile:ofType: method or readFromFile:ofType: are invoked which are designed by Apple to be overwridden though you do not have to. The documement model is very flexable, I've heard others on this mailing mention that documents can reprent things like entries in a databases or what ever you want.
Finally I would just add that I don't know what your application does, but I would be tempted to try make use of save to maybe do something like text representations of the data within you document or something similar.
>--
>Andrew White
>
>--------------------------------------------------------------------------
>This email and any attachments are confidential. They may contain legally
>privileged information or copyright material. You should not read, copy,
>use or disclose them without authorisation. If you are not an intended
>recipient, please contact us at once by return email and then delete both
>messages. We do not accept liability in connection with computer virus,
>data corruption, delay, interruption, unauthorised access or unauthorised
>amendment. This notice should not be removed.
>
>
Nathan Day
email@hidden
http://homepage.mac.com/nathan_day/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden