Re: Is NSDocument read outside init?
Re: Is NSDocument read outside init?
- Subject: Re: Is NSDocument read outside init?
- From: Scott Anguish <email@hidden>
- Date: Thu, 15 Apr 2004 03:25:27 -0400
On Apr 15, 2004, at 3:16 AM, Allan Odgaard wrote:
On 15. Apr 2004, at 7:19, Scott Anguish wrote:
It would seem to me that these are only sent from the initializer
(and revertToSavedFromFile:ofType:), is this assumption safe?
It'd be better to do the read in the read method, and just do any
additional initialization you need to with
initWithContentsOfFile:ofType:. It gives you the opportunity of
doing anything special for a particular file type, but it's not a
replacement for loading the data...
My "problem" is actually to differentiate between a new untitled
document and a document read from disk.
Currently init is called in both cases -- so I need to act as if the
document was untitled and then undo that in the following read method
(if one is sent). And that is what I wanted to avoid (for various
reasons).
if you say so.. :-)
However, reading the conceptual documentation, it would seem that
setting a boolean value in an overloaded
initWithContentsOfFile:ofType: (before calling super) is also a way
for me to learn in which context the init method is called -- not that
I am a fan of this solution, but I think I'll try that for now ;)
it's a valid way of doing it...
_______________________________________________
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.