• 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: How to use Uniform Type Identifiers for this ... ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to use Uniform Type Identifiers for this ... ?
      • From: Jay Reynolds Freeman <email@hidden>
  • Prev by Date: Re: How to use Uniform Type Identifiers for this ... ?
  • Next by Date: Re: Why getting two awakeFromNib messages??
  • Previous by thread: Re: How to use Uniform Type Identifiers for this ... ?
  • Next by thread: Re: How to use Uniform Type Identifiers for this ... ?
  • Index(es):
    • Date
    • Thread