• 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: NSDocumentController and multiple document types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocumentController and multiple document types


  • Subject: Re: NSDocumentController and multiple document types
  • From: Scott Anguish <email@hidden>
  • Date: Tue, 5 Aug 2003 03:36:25 -0400

On Tuesday, August 5, 2003, at 3:04 AM, Francisco Tolmasky wrote:

What is the best course of action if you plan on having more than one document type. I'll just use Project Builder as an example, you can have "project" documents or "text" documents. Do both of these have the same NSDocumentController? Would you still just call [NSDocumentController open:]. How would you intercept and understand which one to choose?


The file types are mapped to NSDocument subclasses in the project's info.plist file (which you can edit in Targets).

So you'd have a single NSDocumentController, but multiple NSDocument subclasses, and when you open the correct one will be created for the appropriate file.

When you create them yourself (if you end up needing to do this -- to make a new document of a specific type as an example) you'll use -makeUntitledDocumentOfType: or -openUntitledDocumentOfType:display:

You could subclass NSDocumentController and override makeUntitledDocumentOfType:/makeDocumentWithContentsOfURL:ofType: if you needed to which type of NSDocument subclass is made for the specific type.
_______________________________________________
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: 
 >NSDocumentController and multiple document types (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: NSDocumentController and multiple document types
  • Next by Date: Re: Arrow character in IB
  • Previous by thread: NSDocumentController and multiple document types
  • Next by thread: Re: Which alternate row color spec is correct?
  • Index(es):
    • Date
    • Thread