Re: Question about plist settings
Re: Question about plist settings
- Subject: Re: Question about plist settings
- From: Laurence Harris <email@hidden>
- Date: Sat, 21 Oct 2006 11:46:37 -0400
On Oct 21, 2006, at 4:29 AM, Chris wrote:
Hi, I'm new to Cocoa. I'm writing an app using 10.4u SDK for OS X
on PPC and Intel. Since I do not intend to support OS 9, am I right
(from reading Apple docs) to leave the following at their default
settings
- CFBundleTypeOSTypes (default '????'). Set CFBundleTypeExtensions
instead.
Use both. A lot of Cocoa applications fail to use types and creator
signatures with their files, but in doing so they potentially give up
useful features available on the Mac that weren't available on NeXT
(the origin of Cocoa thinking). For example:
- If you assign your creator signature to all of your files, then I
can search for all of your files independent of their types or
extensions.
- If you don't provide file types in your plist, files with types
assigned and no extension on their names can't be dragged to your
application's icon (unless you accept all types of files). If you
provide UTIs this may not be an issue depending on the kinds of files
you want users to be able to drag to your application.
- If you support types in addition to extensions, your files don't
require
- Types and extensions can provide different information about a
file's contents. For example, the file type 'TEXT' is appropriate for
use with both .txt and .html extensions (and others). You may have a
file format for which a standard type would be appropriate, but for
which you would use your own extension (some kind of text file would
be the most likely case). Giving those files a type could allow other
applications who don't recognize your extension or UTIs to open those
files.
- Along the lines of the previous issue, the most efficient way to
get a file to open in a specific application is to change the file's
creator signature. The Finder's Open With mechanism does this (IMO
nasty) thing in which it adds a resource fork containing a custom
icon and additional resource specifying the preferred application,
which usually adds at least 40K to the size of the file. Changing the
creator doesn't change anything about the file itself.
- Define UTIs as well, but don't fall into the trap of thinking that
every application supports UTIs. Many still don't.
Trust me when I say that the tendency of Cocoa applications to ignore
these things has been known to create unnecessary challenges for some
users. Unfortunately, those are *Mac* users, and people whose
background was with NeXT didn't seem to think that Mac features had
any value, so they've tended to just ignore them.
I don't know how relevant these features would be to your
application, but realistically it takes very little time to support
them, and I want to cover all the options if it might make life
easier for even a portion of my users.
- CFBundlePackageType (default '????')
- CFBundleSignature (default '????')
Please don't ignore these. If nothing else, it takes very little to
assign values for these. Less time, possibly, than discussing the
value of not using the defaults. Once you've done it you're covered
and you never have to worry about some problem you didn't anticipate
biting you later because you didn't spend a few minutes creating and
assigning those values.
If I'm not supposed to ignore them, does that i) imply I have to
register them with Apple? ii) how do I find out what has been
registered so there won't be a conflict?
You request to register a creator signature and Apple will tell you
if it isn't available. Note that Apple reserves all lowercase four
character codes such as creators and file types for their own use, so
you should have at least one uppercase character in any of yours, and
life is simpler if you stick to ASCII characters.
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden