Re: @protocol vs NSClassFromString
Re: @protocol vs NSClassFromString
- Subject: Re: @protocol vs NSClassFromString
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 21 Jan 2003 19:22:41 -0800
On Tuesday, January 21, 2003, at 06:29 PM, The Amazing Llama wrote:
I understand that these two things are fundamentally different in
results, but they are quite similar in what they do; query the > runtime.
So why isn't it @protocol and @class()? This makes more sense to my
intuition, and is a hell of a lot shorter...
I guess I could implement it myself with something like the following,
but why wasn't it done the way it seems it 'should be' the first time?
#define @class(aClass) NSClassFromString(@"aClass")
@class and @protocol are declarations. NSClassFromString is a runtime
function that searches for a class by name. This can include a class
that wasn't known at compile time.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.