On Aug 2, 2010, at 20:11, Jerry Krinock wrote:

> It seems to me that, throughout Cocoa documentation, Apple uses the phrase 
> "document type" to mean three different things: Display Name, UTI, and 
> Filename Extension.  For example, in the documentation of 
> -writeSafelyToURL:ofType:forSaveOperation:error:, the ofType: parameter is 
> documented as "The string that identifies the document type."  Grrrrrr.
> 
> I know I've submitted Document Feedback on this previously.  I'm in the mood 
> to file a formal bug.  Am I just missing it somewhere?

Historically, "document type" means the string in the plist (what you've called 
the Display Name). Leopard added the ability for that string to be replaced a 
UTI also specified in the plist. Methods expecting a document type string 
distinguish between the two forms, presumably, by the presence of periods in 
the string. In that sense, the Display Name and the UTI are really the same 
thing, or rather alternatives for the same thing. (However, the documentation 
never suggests that you can switch between the two in different NSDocument 
method invocations for a single existing document object. Clearly, you've found 
that doesn't work, though you might have trouble getting it classified as a 
bug.)

Presumably, the UTI version is now preferred to the old kind of string, and 
presumably the old kind will be deprecated at some point, but the supremacy of 
UTIs doesn't seem to have trickled through to the NSDocument documentation yet.

I'm not aware that file extensions are ever regarded as document types, in the 
API or the documentation. The most likely place to specify an extension, in 
Open and Save dialog parameters, is a file type rather than a document type. 
It, too, BTW can be replaced* by a UTI since Leopard, but the mechanism is 
distinct from the alternation of UTIs and document types. With the current file 
system architecture, UTIs don't replace file extensions, because UTIs aren't 
stored anywhere in the file system -- they're just a more robust and indirect 
way of specifying extensions*.

> WHY DID THE OBJECT DISAPPEAR?

I don't have a clue, but if it's not permitted to vary the form of the document 
type string between method invocations, you might also have trouble getting 
this classified as a bug, too.



*File types are also specifiable as 4-character classic file type values, so 
there are actual three alternate means of specifying file type, while there are 
only two (AFAIK) for document types.



_______________________________________________

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