title: Issues with #import and @class cause _OBJC_CLASS_ referenced from error
body: <p>I have two classes.   </p>
  
  <h2>APPagine.h</h2>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  @interface APPagineMedia : NSObject
  @property (nonatomic, retain) NSString *Immagine;
  @property (nonatomic, retain) NSString *Video;
  @end
  
  @interface APPagineDescription : NSObject
  @property (nonatomic, retain) NSString *Descrizione;
  @end
  
  @interface APPagineSommarioLinee : NSObject
  @property (nonatomic, retain) NSString *Description;
  @property (nonatomic, assign) int IdLinea;
  @end
  
  @interface APPagineSommarioCategorie : NSObject
  @property (nonatomic, retain) NSString *Nome;
  @property (nonatomic, assign) int DestId;
  @property (nonatomic, retain) APPagineSommarioLinee *Linee;
  @end
  
  @interface APPagineSommario : NSObject
  @property (nonatomic, retain) APPagineSommarioCategorie *Categorie;
  @end
  
  @interface APPagine : NSObject
  @property (nonatomic, assign) NSString *Layout;
  @property (nonatomic, assign) int Indice;
  @property (nonatomic, retain) NSString *Titolo;
  @property (nonatomic, retain) APPagineMedia *Media;
  @property (nonatomic, retain) APPagineDescription *Descrizione;
  @property (nonatomic, retain) APPagineSommario *Sommario;
  @end
  </code></pre>
  
  <h2>APXmlData.h</h2>
  
  <pre><code>@interface APXmlData : NSObject
  
  @property (nonatomic, retain) NSString *Lingua;
  @property (nonatomic, assign) float Versione;
  @property (nonatomic, assign) long long Timestamp;
  @property (nonatomic, retain) APPagine    *Pagine;
  @property (nonatomic, retain) APCategorie *Categorie;
  @property (nonatomic, retain) APCarousel  *Carousel;
  
  @end
  </code></pre>
  
  <hr>
  
  <p>and finally in my controller interface:</p>
  
  <pre><code>#import "APXmlData.h"
  @interface APViewController : UIViewController
  {
    APXmlData *_XmlData;
  }
  @end
  </code></pre>
  
  <p>and in implementation:</p>
  
  <pre><code>_XmlData.Timestamp = 123;
  _XmlData.Version = 1.0;
  _XmlData.Pagine = [[APPagine alloc] init];
  _XmlData.Pagine.Layout = @"a";
  _XmlData.Pagine.Indice = 1;
  _XmlData.Pagine.Titolo = @"titolo";
  //[...]
  </code></pre>
  
  <hr>
  
  <p>But,<br>
  in when i go to set data to </p>
  
  <pre><code>_XmlData.Pagine = [[APPagine alloc] init];
  </code></pre>
  
  <p>he returns me a linker error, the classic </p>
  
  <blockquote>
    <p>Undefined symbols for architecture i386:<br>
    "_OBJC_CLASS_$_APPagineDescription", referenced from:<br>
          objc-class-ref in APPagine.o   </p>
    
    <p>"_OBJC_CLASS_$_APPagineMedia", referenced from:<br>
          objc-class-ref in APViewController.o<br>
          objc-class-ref in APPagine.o     </p>
    
    <p>"_OBJC_CLASS_$_APPagineSommario", referenced from:<br>
          objc-class-ref in APPagine.o   </p>
    
    <p>ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1
    (use -v to see invocation)</p>
  </blockquote>
  
  <p>My question is: <strong>what is correct way to <code>import</code> the classes in my controller?</strong><br>
  Should be use <code>#import</code> or <code>@class</code>?
  In that order?<br>
  What are the classes that require <code>@class</code> or <code>#import</code>?  </p>
  
  <h2>NOTE</h2>
  
  <p>In <strong>Build -> Compile Sources</strong>, both files are properly configured.<br>
  If i remove <code>_XmlData.Pagine = [[APPagine alloc] init];</code> the apps run well</p>
  
  <p>thanks.</p>