Re: How to use Uniform Type Identifiers for this ... ?
Re: How to use Uniform Type Identifiers for this ... ?
- Subject: Re: How to use Uniform Type Identifiers for this ... ?
- From: Greg Guerin <email@hidden>
- Date: Sun, 25 Oct 2009 19:20:13 -0700
Jay Reynolds Freeman wrote:
The binary-file documents are clickable -- you are supposed to be
able to launch the app by mousing on one. But if the wrong version
of the app gets launched by mistake, it fails. I would like to make
that not happen, mostly so that I can make sure I haven't somehow
broken the click-on-to-launch mechanism since the last time I
tested it.
Rather than trying to trick the system into preventing your
application's crashiness, I recommend making your application less
crash-prone. One simple way to do this is to write a version-number
at the head of your binary file. This should be done in a way that
all versions of the app can read. The remainder of the data can be
crash-inducing if the app doesn't recognize the version-number. Then
write code that reads the uniformly readable version-number, and
decides whether to continue or stop. By "stop" I don't mean crash,
or fail horribly, or quit unexpectedly. I mean refrain from reading
the rest of the file, possibly with an alert. It could even mean
doing nothing but issuing a beep. Anything but crashing.
As a wild guess, it would take less time to implement a version-
numbering scheme than to figure out any UTI trickery. It would also
have the long-term advantage of making your app less crash-prone.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden