Re: Programmatic equivalent to @protocol() macro?
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.