title: Undefined symbols: "_OBJC_CLASS_$ error
body: <p>I've been looking through countless posts about this error: </p>
  
  <pre><code>Undefined symbols:
  "_OBJC_CLASS_$_BoxView", referenced from:
    objc-class-ref-to-BoxView in ViewMovingViewController.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p><code>BoxView</code> is a subclass of <code>UIView</code>, and the <code>UIKit</code> framework has been included. <code>BoxView.h</code> has been imported in the ViewController. </p>
  
  <p>The ViewController contains this code:  </p>
  
  <pre><code>-(void) addBoxViewAtLocation:(CGPoint)point {
      CGRect rect;  
      rect.origin.x = point.x;  
      rect.origin.y = point.y;  
      rect.size.width = 80;  
      rect.size.width = 40;  
      BoxView *newView = [[BoxView alloc] initWithFrame:rect];  
      newView.backgroundColor = [UIColor yellowColor];  
      [mainView addSubview:newView];  
  }  
  </code></pre>
  
  <p>And <code>BoxView</code> contains this code: </p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame {     
      self = [super initWithFrame:frame];  
      if (self) {  
          // no further initialization  
      }  
      return self; 
  }  
  </code></pre>
  
  <p>This is the line that's causing the error, from the code above:</p>
  
  <pre><code>BoxView *newView = [[BoxView alloc] initWithFrame:rect];
  </code></pre>
  
  <p>When I change <code>BoxView</code> to <code>UIView</code> in that line, the error goes away. Does anyone know what I need to change here? I have looked through many posts about this, but most answers say it's link related, but I've tried ticking and unticking certain boxes with no success. I'm wondering if the error is in my code? Any suggestions would be appreciated!</p>