• 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: Forwarding and forwardInvocation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forwarding and forwardInvocation


  • Subject: Re: Forwarding and forwardInvocation
  • From: John Hörnkvist <email@hidden>
  • Date: Wed, 19 Sep 2001 19:19:15 +0200

On Wednesday, September 19, 2001, at 06:48 PM, Richard Schroedel wrote:

I am trying to use forwardInvocation. Unfortunately the object that declares it never receives control at it's forwardInvocation method. Instead I just get the usual "undefined method" error message. Any ideas out there?

You must implement methodSignatureForSelector:.

- (NSMethodSignature*)methodSignatureForSelector;(SEL)selector
{
NSMethodSignature* signature =[super methodSignatureForSelector:selector];
if (! signature)
signature =[delegate methodSignatureForSelector;selector];

return signature;
}

The runtime uses the method signature to collect the arguments from the stack and register state.

Hardcore Objective-C programmers that want to collect the arguments manually or do return value magic can do so by overriding forward:: instead.

Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com


References: 
 >Forwarding and forwardInvocation (From: Richard Schroedel <email@hidden>)

  • Prev by Date: Services key equivalent question
  • Next by Date: Re: Aqua Interface Guidelines & Close Window location ?
  • Previous by thread: Forwarding and forwardInvocation
  • Next by thread: Re: Forwarding and forwardInvocation
  • Index(es):
    • Date
    • Thread