• 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: Programmatic equivalent to @protocol() macro?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatic equivalent to @protocol() macro?


  • Subject: Re: Programmatic equivalent to @protocol() macro?
  • From: petite_abeille <email@hidden>
  • Date: Sat, 15 Mar 2003 12:28:28 +0100

On Friday, Mar 14, 2003, petite_abeille wrote:

Is there a programmatic equivalent to the @protocol() macro?

Something along the lines of NSClassFromString()... perhaps ProtocolFromString()?

Well... turns out this is not a piece of cake :-(

"The compiler creates a Protocol object for each protocol declaration it encounters, but only if the protocol is also:
* Adopted by a class, or
* Referred to somewhere in source code (using @protocol())."

-- The Objective-C Language, Chapter 3, The Objective-C Extensions
http://www.toodarkpark.org/computers/objc/moreobjc.html

Which is a bummer... one can always enumerate all the protocols which have a concrete implementation by looping through all the classes and asks for their protocols... but... this doesn't tell anything about protocol only referenced through the @protocol() directive... sigh...

Any ideas where protocols without an implementation are stored?

<rant>
Is it not time to take out Protocol from its lasting misery and bring it to the 21st century? Even something as lame as Java handles interfaces as first class citizen... why can't objc do the same? So much for "a full featured set of classes designed to create robust and powerful Mac OS X applications". Duh.
</rant>

Cheers,

PA.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Programmatic equivalent to @protocol() macro? (From: petite_abeille <email@hidden>)

  • Prev by Date: grid on picture
  • Next by Date: Re: Saving data to a file
  • Previous by thread: Programmatic equivalent to @protocol() macro?
  • Next by thread: Documents Alias
  • Index(es):
    • Date
    • Thread