• 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: Document-based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document-based app


  • Subject: Re: Document-based app
  • From: Camillo Lugaresi <email@hidden>
  • Date: Thu, 29 Dec 2005 16:00:04 +0100

On 29/dic/05, at 05:38, Laurent Michel wrote:

Hi!

A quick question.

I am writing a Document based app. When the app starts, it creates an "Untitled" document. On the first "Open" request, a new window is created to host the chosen document. All of this works fine. However, one 'reviewer' pointed out that this is not how "TextEdit" (for instance) behaves. Indeed, on the first "open" request, the chosen document replaces the content of the "Untitled" window.

So,... how should I go about replicating that behavior of textEdit? Subclassing NSDocumentController?

Any pointer is most welcomed.

I think what TextEdit does is this:
- if it's launched without any documents, it creates a new empty document as usual, but it also sets a flag;
- if the new file is edited, the flag is cleared;
- if an open request arrives, and the flag is still set, the empty untitled document is close, the requested document is opened in its place, and the flag is cleared.

Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Document-based app
      • From: Laurent Michel <email@hidden>
References: 
 >Document-based app (From: Laurent Michel <email@hidden>)

  • Prev by Date: Custom Control Hit Mask
  • Next by Date: Re: Custom Control Hit Mask
  • Previous by thread: Document-based app
  • Next by thread: Re: Document-based app
  • Index(es):
    • Date
    • Thread