• 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: New Cocoa Programmer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Cocoa Programmer


  • Subject: Re: New Cocoa Programmer
  • From: Marcel Weiher <email@hidden>
  • Date: Mon, 12 Nov 2001 11:46:48 +0100

On Monday, November 12, 2001, at 10:52 AM, Ondra Cada wrote:

Marcel,

Marcel Weiher (MW) wrote at Mon, 12 Nov 2001 09:26:09 +0100:
MW> Actually, this could be compiled back when class-names by themselves
MW> could be used
MW>
MW> switch ( [myObject class] ) {
MW> case NSString:
MW> break;
MW> }

I'm not that sure:

That's OK. I am positive that factory objects could be referenced directly, for example in equality tests ( if ( *(Class*)object == List ))). I am not 100% certain this would work in switch-statements.

so far as I remember, Brad Cox always made point of that
a class name is always interpreted as a _type_ with the sole exception of
being a receiver of a message.

Brad Cox and types?? The "class name" refers to the *factory object* of the class (or alternatively the shared part / shared structure). This is really just an ordinary object, except that it is typically generated statically by the compiler.

Marcel


  • Follow-Ups:
    • Re: New Cocoa Programmer
      • From: Ondra Cada <email@hidden>
    • Re: New Cocoa Programmer
      • From: Ondra Cada <email@hidden>
References: 
 >Re: New Cocoa Programmer (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Why does TableView not respond to it's inherits methods?
  • Next by Date: Re: Why does TableView not respond to it's inherits methods?
  • Previous by thread: Re: New Cocoa Programmer
  • Next by thread: Re: New Cocoa Programmer
  • Index(es):
    • Date
    • Thread