FROM : Philip Mötteli
DATE : Mon Apr 25 19:37:36 2005
Am 25.04.2005 um 18:45 schrieb Aurélien Hugelé:
> On 24 avr. 05, at 23:58, Philip Mötteli wrote:
>> 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;
>>
>
> are you using tiger ?
No, but 10.3.9.
> almost all of my DO code gives me the same error on 10.4, it was
> working like a charm under 10.2 and 10.3
> i think it is a bug in Cocoa DO since 10.4, but i'm not sure...
I think, too.
> i must recognized that i'm lost here...
Me too.
> have you tried a trivial OD test ?
Yes. Trivial method calling works for me. But just not multiple
inheritance (so far).
Re
Phil
DATE : Mon Apr 25 19:37:36 2005
Am 25.04.2005 um 18:45 schrieb Aurélien Hugelé:
> On 24 avr. 05, at 23:58, Philip Mötteli wrote:
>> 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;
>>
>
> are you using tiger ?
No, but 10.3.9.
> almost all of my DO code gives me the same error on 10.4, it was
> working like a charm under 10.2 and 10.3
> i think it is a bug in Cocoa DO since 10.4, but i'm not sure...
I think, too.
> i must recognized that i'm lost here...
Me too.
> have you tried a trivial OD test ?
Yes. Trivial method calling works for me. But just not multiple
inheritance (so far).
Re
Phil
| Related mails | Author | Date |
|---|---|---|
| Philip Mötteli | Apr 24, 23:58 | |
| Aurélien Hugelé | Apr 25, 18:45 | |
| Philip Mötteli | Apr 25, 19:37 |






Cocoa mail archive

