title: UIGestureRecognizer causing "EXC_BAD_ACCESS" error
body: <p>Using the GestureRecognizer attached to a view triggers my app to crash with <strong>EXC_BAD_ACCESS</strong> error. Here's the classes involved</p>
  
  <p>• <strong>BoardViewController</strong> - Displaying a board (as background) set as rootViewController in the AppDelegate. It instantiates multiple objects of the "TaskViewcontroller".</p>
  
  <pre><code>//BoardViewController.h
  @interface BoardViewController : UIViewController {
      NSMutableArray* allTaskViews; //for storing taskViews to avoid having them autoreleased
  }
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>//BoardViewController.m - Rootviewcontroller, instantiating TaskViews    
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      TaskViewController* taskA = [[TaskViewController alloc]init];
      [allTaskViews addObject:taskA];
      [[self view]addSubview:[taskA view]];
  }
  </code></pre>
  
  <p>• <strong>TaskViewController</strong> - An indivual box displayed on the board. It should be draggable. Therefore I attached UIPanGestureRecoginzer to its view</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIPanGestureRecognizer* panRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(handlePan:)];
      [[self view] addGestureRecognizer:panRecognizer];
  }
  
  - (void)handlePan:(UIPanGestureRecognizer *)recognizer {
      NSLog(@"PAN!");
  }
  </code></pre>
  
  <p>The .xib file is a simple view. </p>
  
  <p><img src="https://i.stack.imgur.com/C91Ip.jpg" alt="enter image description here"></p>
  
  <p>All programming with the gesture recognizer I'd prefer to do in code. Any idea how to fix the error causing the app crash?</p>