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

Re: NSDocument-based app limitations?


  • Subject: Re: NSDocument-based app limitations?
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 30 Mar 2004 00:11:23 -0800

On Mar 29, 2004, at 11:46 PM, Mark Munz wrote:
I see not being able to dynamically manipulate the list of filetypes as a weakness. TextEdit gets around this by doing everything by hand.

But TextEdit doesn't use the document architecture...
The appropriate thing to do is for the document itself to advertise what types it supports. Those will then be listed in the Save panel:
<http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ Tasks/FAQ.html>

Sketch shows how to use a document model, but again it's very simple (one document type -- no dynamic changes to the type of document).

On the contrary, it only allows a single native type, but allows you to save as PDF and TIFF.


So I'll rephrase my main question. Can I dynamically change the filetypes that show up in the save dialog? Do I hack in and muck with the UI elements (doesn't seem the "right way" -- but maybe that's the way everyone does it)? Or do I have to by-pass the whole NSDocument code completely and do it myself (like TextEdit does)?
Why do you need to dynamically change the filetypes?
Well, there's a fundamental difference between plain text files and Rich Text files. One way to accomplish this is via TextEdit's switch on the fly design. Another way is to create distinct document types. The downside of the ladder approach is that it requires the user to decide up front which type they want and if they want to change after the initial creation, it's more difficult to switch between the two (UI experience wise).
Another example that might also require dynamically setting up the filetypes supported -- plug-in
filters that support additional type conversions as save.


<http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ Tasks/FAQ.html>
"How can I support reading one type and (internally) automatically converting to another?"

The above all seemed like very straightforward questions. The original email (look at the thread) I posted also ask specific questions to try to solve the same issue. So you jumped into the middle of the discussion and just assumed that all I did was complain about the weakness in the architecture.

Actually, I read the original messages as well -- the subject line is, "NSDocument-based app limitations", and the first paragraph complains, "However, it seems that NSDocument is designed for only the most basic examples of documents." This is clearly not the case.

Yes, I've read the above documentation as well and I know that TextEdit isn't an NSDocument based application (that was made cleaner in both my original message & the reply to Scott's). What I am looking for is information on doing something beyond simple document that all the books & sample code talk about.

See the FAQ mentioned above, and also:
<http://cocoa.mamasam.com/COCOADEV/2004/01/2/82162.php>

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-based app limitations? (From: Mark Munz <email@hidden>)
 >Re: NSDocument-based app limitations? (From: Scott Anguish <email@hidden>)
 >Re: NSDocument-based app limitations? (From: Mark Munz <email@hidden>)
 >Re: NSDocument-based app limitations? (From: mmalcolm crawford <email@hidden>)
 >Re: NSDocument-based app limitations? (From: Mark Munz <email@hidden>)

  • Prev by Date: Re: NSBitmapImageRep returns wrong bitsPerSample and bitsPerPixel values for 8 & 16-bit BMP's
  • Next by Date: Re: NSDocument-based app limitations?
  • Previous by thread: Re: NSDocument-based app limitations?
  • Next by thread: Re: NSDocument-based app limitations?
  • Index(es):
    • Date
    • Thread