• 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: Catch an exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catch an exception


  • Subject: Re: Catch an exception
  • From: Finlay Dobbie <email@hidden>
  • Date: Fri, 4 Nov 2005 15:17:29 +0000

On 04/11/05, malcom <email@hidden> wrote:
> Hello,
> Is possible to capture an exception in method calling?

Yes:
<http://developer.apple.com/documentation/Cocoa/Conceptual/Exceptions/index.html>


> Example:
> I have a class with this method
>
> attachToClass:(id) responderClass;
>
> in another function the class call a method of responderClass. Now I
> would to generate an error event if 'selector is not recognized' (this
> class does not respond to this method).

It might be better to check if the class responds to a given selector
before attempting to call it (see NSObject's respondsToSelector)
rather than trying to handle the exception.

 -- Finlay
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Catch an exception (From: malcom <email@hidden>)

  • Prev by Date: Printing a non document based textView
  • Next by Date: Wanted: Cocoa-developer and business partner (preferably Atlanta)
  • Previous by thread: Catch an exception
  • Next by thread: newbie: adding nibs: i'm stuck
  • Index(es):
    • Date
    • Thread