• 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: Problem with protocols using gcc 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problem with protocols using gcc 4
      • From: Kyle Hammond <email@hidden>
References: 
 >Problem with protocols using gcc 4 (From: Kyle Hammond <email@hidden>)
 >Re: Problem with protocols using gcc 4 (From: j o a r <email@hidden>)

  • Prev by Date: [still having probs] Re: Printing my document
  • Next by Date: SimpleBrowser Path for column 0
  • Previous by thread: Re: Problem with protocols using gcc 4
  • Next by thread: Re: Problem with protocols using gcc 4
  • Index(es):
    • Date
    • Thread