• 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: Andrea Salomoni <email@hidden>
  • Date: Fri, 9 Dec 2005 11:12:03 +0100

Thank you Frederick,

so I can use it in this way:

@class MYClassB
@header MYClassA

{
something
}


@class MYClassA
@header MYClassB

have to use #import "MYClassA.h" in the implemetation of MYClassB?

thank you again
Andrea

Il giorno 09/dic/05, alle ore 10:57, Frederick Cheung ha scritto:

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: Frederick Cheung <email@hidden>
References: 
 >@class (From: Andrea Salomoni <email@hidden>)
 >Re: @class (From: Frederick Cheung <email@hidden>)

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