• 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
How to know that a NSDocument is new or open from a file ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to know that a NSDocument is new or open from a file ?


  • Subject: How to know that a NSDocument is new or open from a file ?
  • From: jean-michel daix <email@hidden>
  • Date: Fri, 14 Feb 2003 12:18:52 +0100

Hi,

I9ve got a Document based application and I want to perform different
initializations if the document has been open from a file or is a new
document.

I have put a part of my initialization in "loadDataRepresentation" (for the
file opened ) but I don't know exactly where to put the initialization code
for my new file.

If I put it in "Init" it's not good because "init" is called before
"loadDataRepresentation" and my opened file is init two times.

I think there's certainly two solutions to my problem but don't know how to
do :

1) In the init of my NSDocument, how to know that my document is new and not
open from a file ?

(May be I can create a flag for this but I hope there's something already in
cocoa that I don't know which can tell me that )

2) May be I should put my code for the initialization of my new document
somewhere else but where ?

Thanks for the help !


-----------------------------------
Jean-Michel DAIX / <email@hidden>
Sorry, I m French !

visit <http://www.adforum.com>
_______________________________________________
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.

  • Prev by Date: NSStatusItem hack (free code!!)
  • Next by Date: Re: NSStatusItem hack (free code!!)
  • Previous by thread: Re: NSStatusItem hack (free code!!)
  • Next by thread: Protecting singleton objects from releasing
  • Index(es):
    • Date
    • Thread