Re: ObjC error messages
Re: ObjC error messages
- Subject: Re: ObjC error messages
- From: Malte Tancred <email@hidden>
- Date: Thu, 14 Feb 2002 15:24:57 +0100
On thursday, february 14, 2002, at 03:00 , Marcel Weiher wrote:
This is really just the default behavior for unrecognized messages, and
it seems quite reasonable that the default is to print a message, as
this is an exceptional situation that (in its unhandled state) is
comparable to a type-error that would prevent compilation in a strict
statically-typed language (and produce an error message).
I agree that some sort of logging should occurr if the exception
isn't handled. But I still argue that it should be handled the way
all other uncaught exceptions are handled, ie through the top level
execption handler.
In the case where I actually handle such an error (by catching
the exception that is in fact raised), shouldn't I be the one
deciding whether to log or not?
One could look at it this way: if I decide to handle a possible
exception then it won't be, in a sense, an exception anymore. :-)
(until I decide otherwise and reraise the exception or raise
another one).
You have several options for handling this error yourself.
1. override -doesNotRecognizeSelector: either only in your own
objects or globablly in a category
2. override -forwardInvcation: in order to handle situations in which
you don't actually consider it an error
In my opinion this would be a 'fix' to an inconsistency in the
design of Apple's frameworks. I suggest the inconsistency is corrected.
It's not a big deal as there are ways to work around the (minor)
problem, but that workarounds are availble doesn't make a correction
unnecessary, right?
Cheerio,
Malte
--
Malte Tancred
Computer programmer, Oops AB, Sweden
mailto:email@hidden
http://www.oops.se/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.