title: Does the automatic reference counting release an object if i set the pointer to nil?
body: <p>Does the automatic reference counting release an object if I set the pointer to nil or assign the pointer to another object?</p>
  
  <p>For example doing something like that:</p>
  
  <pre><code>//in .h file
  
  @interface CustomView : UIView
  {
     UIView *currentView;
  }
  
  
  // in .m file:
  
  -(void)createView1
  {
     currentView = [[UIView alloc] init];
     [self addSubview:currentView];
  }
  
  -(void)createView2
  {
     [currentView removeFromSuperview];
  
     // does the former view get released by arc
     // or does this leak?
     currentView = [[UIView alloc] init];
     [self addSubview:currentView];
  }
  </code></pre>
  
  <p>If this code leaks, how would I declare *currentView properly? Or how would I make ARC "release" the currentView? thanks!</p>