• 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: @protocol vs NSClassFromString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >@protocol vs NSClassFromString (From: The Amazing Llama <email@hidden>)

  • Prev by Date: Re: COCOA: Simplest Way of Formatted Text
  • Next by Date: syncing NSTimer with system clock...
  • Previous by thread: Re: @protocol vs NSClassFromString
  • Next by thread: Toolbar woes...
  • Index(es):
    • Date
    • Thread