Re: default method on an object
Re: default method on an object
- Subject: Re: default method on an object
- From: Peter Ammon <email@hidden>
- Date: Fri, 06 Jul 2001 10:32:32 -0700
on 7/6/01 9:24 AM, Jeff Medcalf at email@hidden wrote:
>
Is there a way in Cocoa, to declare a method, such that a message to
>
the object containing that method, which does not find a method to
>
invoke, will invoke that method instead. In other words, if I have a
>
class with 1 method, myMethod:, and it gets a message like [myObject
>
someOtherMethod:], is there a way that I can have myMethod: invoked
>
instead of an error being generated?
>
>
Thanks
>
>
-jeff
Of course you can; what do you think this is, C++? ;)
forwardInvocation: is the method that gets called when an object is sent a
message it doesn't understand. Check out the description for
forwardInvocation: in the NSObject docs.
-Peter