title: Trying to prevent memory leak
body: <p>I am trying to do some experiment.</p>
  
  <pre><code>- (IBAction)btn1Action:(id)sender {
      dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
          [self performSegueWithIdentifier:@"popvc2id" sender:self];
      });
  
      NSLog(@"TAP");
  }
  </code></pre>
  
  <p>When button will tap it will take 1 second to perform segue and when this button tapped again it will trigger segue twice, so two instance of <code>ViewController</code> will be created.</p>
  
  <p>In instruments I can see two instances but one of them is <code>leaked VC object</code>.</p>
  
  <p>Now what I am trying to do is</p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
      VC2 *vc2 = [segue destinationViewController];
      [ary addObject:vc2];
      if(ary.count &gt; 1) {
          VC2 *vc = (VC2*)ary[1];
          vc = nil;
          [ary removeObjectAtIndex:1];
      }
      [ary removeAllObjects];
      NSLog(@"-&gt; %@", vc2);
  }
  </code></pre>
  
  <p>to keep a record of <code>VC objects</code> and try to destroy the second obj, so I can prevent memory leak.</p>
  
  <p>But its not working, how to I can fix it?</p>