• 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
BUG?: Multiple Inheritance and DO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BUG?: Multiple Inheritance and DO


  • Subject: BUG?: Multiple Inheritance and DO
  • From: Philip Mötteli <email@hidden>
  • Date: Sun, 24 Apr 2005 23:58:02 +0200

Hi


Has Apple changed something with their implementation of Distributed Objects? Do they always call -methodDescriptionForSelector: before calling the real method?
I have an object, that implements multiple inheritance. I have done this, by implementing the following methods:


- (void)forwardInvocation:(NSInvocation *)anInvocation;
- (BOOL)respondsToSelector:(SEL)aSelector;
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector;

So far everything worked well. But since recently, I see the NSConnection make the following call, before calling the real method:

-[anObject methodSignatureForSelector:@selector(methodDescriptionForSelector:)]


Of course this returns something, because -methodDescriptionForSelector: is implemented by Apple in NSObject. But then in this method they seem to try to extract some information about the real method, that was called. Unfortunately, the real method is not part of the original object, but part of the multiple inheritance, so another object. So I get a 'method not implemented' error.
So I thought, we apparently have to implement another method in order to achieve multiple inheritance:


- (struct objc_method_description *)methodDescriptionForSelector:(SEL)aSelector
{
struct objc_method_description *aDescription = [super methodDescriptionForSelector:aSelector];
if(aDescription)
return aDescription;


	return [[self otherObject] methodDescriptionForSelector:aSelector];
}


This then gives the following DO error:

_preInitWithCoder:signature:valid:wireSignature:target:selector: argCount: incompatible method params: got NSMethodSignature: types=^{objc_method_description=:*}@:: nargs=3 sizeOfParams=160 returnValueLength=4; want NSMethodSignature: types=^{objc_method_description=}@:: nargs=3 sizeOfParams=160 returnValueLength=4;


How do I implement multiple inheritance with DO?


Thanks Phil

_______________________________________________
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


  • Follow-Ups:
    • Re: BUG?: Multiple Inheritance and DO
      • From: Aurélien Hugelé <email@hidden>
  • Prev by Date: Popup button & IB questions
  • Next by Date: NSArchiver question
  • Previous by thread: Re: Popup button & IB questions
  • Next by thread: Re: BUG?: Multiple Inheritance and DO
  • Index(es):
    • Date
    • Thread