• 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: NSDocument application: How do I maintain a single window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument application: How do I maintain a single window?


  • Subject: Re: NSDocument application: How do I maintain a single window?
  • From: mmalcolm crawford <email@hidden>
  • Date: Sun, 6 Jun 2004 13:58:16 -0700

On Jun 6, 2004, at 12:44 PM, Frederick C. Lee wrote:
I'm using the routine: <- (BOOL)loadDataRepresentation:(NSData *)data
ofType:(NSString *)type { > to read data from disk (a serialized
dictionary).
I don't need another window created. How can I maintain just the one
window and re-populate it vs creating another window with each use of
the loadDataRep... method?

Is there any particular reason for using the document architecture? It sounds like you'll just be working against what it's intended for. It would probably be easier to simply create a single-window application and handle file opening directly.

If you really want to use the document architecture, you'll probably need a subclass of NSDocumentController, and override openDocumentWithContentsOfFile:display:

<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSDocumentController.html#// apple_ref/doc/uid/20000030/openDocumentWithContentsOfFile_display_>

mmalc
_______________________________________________
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: 
 >NSDocument application: How do I maintain a single window? (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Re: multiple window per document problems
  • Next by Date: debugging OCUnit tests with XCode
  • Previous by thread: NSDocument application: How do I maintain a single window?
  • Next by thread: NSScrollView subclassing oddness
  • Index(es):
    • Date
    • Thread