• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is NSDocument read outside init?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Is NSDocument read outside init? (From: Allan Odgaard <email@hidden>)
 >Re: Is NSDocument read outside init? (From: Scott Anguish <email@hidden>)
 >Re: Is NSDocument read outside init? (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: Is NSDocument read outside init?
  • Next by Date: Re: Install Program for Completed App
  • Previous by thread: Re: Is NSDocument read outside init?
  • Next by thread: Re: Is NSDocument read outside init?
  • Index(es):
    • Date
    • Thread