title: Method call from subclass to view controller confusion
body: <p>I have a method in my ViewController that adds an image view. The image view is in turn subclassed to be draggable. When touched, the subclass triggers a method (spawnImage) in ViewController to spawn a new image. If I call this method from within any other place in ViewController, the image is drawn correctly, however if the call originates from the subclass, the method gets called, the NSLog works but the image doesn't show up. </p>
  
  <p>It seems like I'm creating another instance of ViewController in the subclass and end up adding the image to that one instead of in the one that is actually shown.</p>
  
  <p>How could I solve this?</p>
  
  <p>Subclass of UIImageView: </p>
  
  <pre><code>- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
  …
  ViewController *viewController = [[ViewController alloc] init];
  [viewController checkIfImageIsInOriginalPosition:selfCenter letterIndex: imgTag];
  }
  </code></pre>
  
  <p>ViewController.m:</p>
  
  <pre><code>-(void)checkIfImageIsInOriginalPosition:selfCenter letterIndex: imgTag {
  …
  else {
  [self spawnImage];
  }
  }
  
  -(void)spawnImage {
  …
  NSLog(@"Received");
  SubClass *subClass = [[SubClass alloc] initWithFrame:frame];
  [subClass setImage:image];
  [self.view addSubview:subClass];
  }
  </code></pre>