Re: Problem with protocols using gcc 4
Re: Problem with protocols using gcc 4
- Subject: Re: Problem with protocols using gcc 4
- From: The Karl Adam <email@hidden>
- Date: Wed, 22 Jun 2005 10:25:34 -0400
He could also use a specialized version of that same protocol since he
seems to be specializing certain methods.
Something like:
@protocol MyProtocolSubclass <MyProtocol>
- (NSString *)stringForObject:(MyClass <MyProtocol> *)inObj;
@end
Only problem is that neither solution will really make the warnings go
away if I understand the problem correctly. While both will work the
compiler regards (MyClass *) and (MyClass <MyProtocol> *) as different
types, as such you can't override one method with the other or fulfill
that method without another.
If he goes with my method he'll get the warning that the original
method is not implemented, and with joar's method he should get the
same warning about a missing implementation for the original method
-(NSString *)stringForObject:(MyClass *)inObj.
-Karl
On 6/21/05, j o a r <email@hidden> wrote:
>
> Would something like this work?:
>
> @interface Foo : NSObject < ProtoA >
> - (void) someMethod: (id < ProtoA, ProtoB >) obj;
> @end
>
> @interface Bar : Foo < ProtoB >
> @end
>
> Just make sure that the methods you need to call from "someMethod:"
> are declared in the ProtoA protocol.
>
> j o a r
>
>
>
>
> _______________________________________________
> 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
>
>
>
_______________________________________________
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