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

Re: @class


  • Subject: Re: @class
  • From: Frederick Cheung <email@hidden>
  • Date: Fri, 9 Dec 2005 09:57:31 +0000

It's for forward declaring classes. @class NSFoo; basically tells the
compiler "there is an (obj-c) class NSFoo, you haven't see the
declaration for it yet but don't worry it's coming later" so that the
compiler won't barf if (for example) you have an instance variable of
type NSFoo*.

You can use it to avoid having to #import the header file that defines
the class into a header (often you would use this to avoid having
circular dependencies (ie A.h imports B.h and B.h imports A.h)

Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: @class
      • From: Andrea Salomoni <email@hidden>
References: 
 >@class (From: Andrea Salomoni <email@hidden>)

  • Prev by Date: @class
  • Next by Date: Re: @class
  • Previous by thread: @class
  • Next by thread: Re: @class
  • Index(es):
    • Date
    • Thread