On Nov 29, 2006, at 9:38 AM, Lynn Allan wrote:
I'm developing an app that does a number of large memory allocations
that it uses during the "life" of the app. I've been using
ErrFatalDisplayIf during development, but my impression is that this
is inappropriate for Release.
Is there a general guideline on the preferred way to handle this? (I
suppose the best answer will be the always popular "it depends" :-)
The app is unusable if not enough memory is available. I was going to
look into try/catch, but wanted to check before proceeding with that
approach.
Try/Catch is a good method for dealing with errors, if you put some
thought into where to catch errors in the design stage. Retrofitting
code with try/catch tends to be harder and less satisfactory.
The "standard" way of error notification is a separate Alert for each
error condition, with some custom text in the message if appropriate.
Alerts don't take up a lot of space in storage, and none in your code
segment. They also internationalize easily. However, dismissing a lot
of non-fatal warning dialogs can get old fast.
If there is space in your UI, a status/error line is often appropriate
-- the user does not need to waste time dismissing a dialog before
continuing. In some cases, seeing the error message next to the control
settings that produced it makes the solution obvious.
There are actually two kinds of information that can be displayed when
an error happens -- user-friendly info on what the problem generally is
and suggestions on resolve it, and detailed info on what specifically
was the problem, which is mostly of interest to technical staff. Well
written UI shows the first info to all users, with something like a
disclosure triangle to display the gory details. Alas, Palm OS
provides no direct support for disclosure triangles, so you'd need to
code that yourself. (Unless some public-spirited developer has written
a disclosure triangle gadget and would like to share it with us?)
Doug Reeder
Cognitive & Systematic Musicology Lab
OSU School of Music
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/