• 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: Is selector in protocol?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is selector in protocol?


  • Subject: Re: Is selector in protocol?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 24 Oct 2001 14:54:37 -0700

On Wednesday, October 24, 2001, at 01:59 PM, email@hidden wrote:

On Wednesday, October 24, 2001, at 10:15 PM, Paul Mix wrote:

Is there a way to tell if a particular selector is declared in a formal protocol? I'd like to use forward-invocation on an object, determining which object to forward to based on which protocol the forwarded-selector is declared in.

Look at "/usr/include/Protocol.h".

Actually, /usr/include/objc/protocol.h.

How about
if([@protocol(someProtocol) descriptionForInstanceMethod:theSelector])

I don't think this is legal. @protocol is a compiler directive to begin a protocol declaration, like @interface or @implementation. It's not like @selector or @encode.

That line should be:

if([someProtocol descriptionForInstanceMethod:theSelector])

-jcr


"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


  • Follow-Ups:
    • Re: Is selector in protocol?
      • From: "Erik M. Buck" <email@hidden>
    • Re: Is selector in protocol?
      • From: Paul Mix <email@hidden>
    • Re: Is selector in protocol?
      • From: email@hidden
  • Prev by Date: Re: Is selector in protocol?
  • Next by Date: Re: Is selector in protocol?
  • Previous by thread: Re: Is selector in protocol?
  • Next by thread: Re: Is selector in protocol?
  • Index(es):
    • Date
    • Thread