I am seeing that now with a sample app I am working with.

I have 22 file types, each with its own C++ methods for extracting its data.

Now, I could use just one subclass of NSDocument and in the

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error: (NSError **)outError

method do a case statement on typeName BUT I think it would be cleaner to subclass NSDocument for each of my file types and override only the read and write methods.

Do I grok!


On Jul 26, 2009, at 9:13 PM, David LeBer wrote:


On 26-Jul-09, at 10:50 PM, David Blanton wrote:

Should Document-Based Applications only be used for apps whose main data type is text?

If an apps main data type comes from a number of different file formats and is represented as a bitmap would a Document-Based Application be a choice?

Just askin'.


Sure.

"Document-Based Application" generally refers to an application that can have multiple document windows open at once and is probably built using Cocoa's document architecture (NSDocumentController/ NSDocument/NSWindowController). Those classes make no assumption about what those documents contain.

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:        http://www.linkedin.com/in/davidleber
twitter:        http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org







_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to