title: dealloc method is not invoked when set an object to nil
body: <p>I have a question. </p>
  
  <p>I first created an object which extends NSObject, I provided overrides for the description and dealloc methods. Here's my Employee.m file:</p>
  
  <pre><code>@implementation Employee
  .....
  
  -(NSString *)description
  {
      return [NSString stringWithFormat:@"Employ ID: %d has $%d value of assets", [self     employeeID], [self valueOfAssets]];
  }
  
  -(void)dealloc
  {   
      NSLog(@"deallocating.. %@", self);
      [super dealloc];
  }
  </code></pre>
  
  <p>In my main.m, I first created an NSMutableArray to hold a list of Employee objects:</p>
  
  <pre><code>NSMutableArray *employees = [[NSMutableArray alloc] init];
  
  for (int i =0; i&lt; 10; i++)
  {
      // Create an instance of Employee
      Employee *person = [[Employee alloc] init];
  
      // Give the instance varaible interesting values
      [person setEmployeeID:i];
      [employees addObject: person];
  }
  </code></pre>
  
  <p>and at the end I set employees to nil</p>
  
  <pre><code>employees = nil;
  </code></pre>
  
  <p>I expected the <code>dealloc</code> method of each Employee object to be called and I would see some logs like:</p>
  
  <pre><code>deallocating.. Employ ID 0 has value.....
  deallocating.. Employ ID 2 has value.....
  ....
  </code></pre>
  
  <p>However, I didn't see any logs and if I set a breakpoint on the <code>dealloc</code> method, the breakpoint is never hit.</p>
  
  <p>Any thoughts?</p>