• 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
forwardInvocation: Works Locally but crashes with DO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

forwardInvocation: Works Locally but crashes with DO


  • Subject: forwardInvocation: Works Locally but crashes with DO
  • From: Joe Lester <email@hidden>
  • Date: Wed, 7 Aug 2002 09:54:27 -0500

My app (let's call it App1) is using a lightweight object to forward unrecognized messages to its "surrogate" object. I do this by overriding "forwardInvocation :" and "methodSignatureForSelector:". It works great locally but when I try to access this object from my other app (App2) using a remote proxy, App1 crashes with a signal 10.

If I remove "forwardInvocation :" and "methodSignatureForSelector:" from my lightweight object and add direct accessor methods instead everything works great... no crashes when App2 tries to connect to App1.

What gives? I would like to use message forwarding since it is much more elegant that having to clutter up a lightweight class with all those darn accessor methods. Any ideas? Here are the two methods that I had to remove (but I would like to get working):

id surrogateObj;

- (void)forwardInvocation:(NSInvocation *)invocation
{
if ([surrogateObj respondsToSelector:[invocation selector]])
{
[invocation invokeWithTarget: surrogateObj];
}
else
{
[self doesNotRecognizeSelector:[invocation selector]];
}
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
{
if ([self respondsToSelector:aSelector])
{
return [self methodSignatureForSelector:aSelector];
}
else
{
return [surrogateObj methodSignatureForSelector:aSelector];
}
}
_______________________________________________
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.

  • Follow-Ups:
    • Re: forwardInvocation: Works Locally but crashes with DO
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Accessors (can we close it this way?)
  • Next by Date: iTunes programming
  • Previous by thread: Help! password storage and usage
  • Next by thread: Re: forwardInvocation: Works Locally but crashes with DO
  • Index(es):
    • Date
    • Thread