title: Simple UITableView memory leak
body: <p>I have a problem with a memory leak in a simple app. The code is taken from a book iPhone iOS Development Essentials. The code is as follows:</p>
  
  <p>The h file</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  &lt;UITableViewDelegate, UITableViewDataSource&gt;
  
  @property (strong, nonatomic) NSArray *colorNames;
  @end
  </code></pre>
  
  <p>and the m file</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  @synthesize colorNames;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      self.colorNames = [[NSArray alloc] initWithObjects:@"blue", @"red",@"green",@"yellow", nil];
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
      self.colorNames = nil;
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
          return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
      } else {
          return YES;
      }
  }
  - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return [self.colorNames count];
  }
  
  -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if(cell==nil)
      {
          cell = [[UITableViewCell alloc] 
                  initWithStyle:UITableViewCellStyleDefault
                  reuseIdentifier:CellIdentifier];
      }
      cell.textLabel.text = [self.colorNames objectAtIndex:[indexPath row]];
      return cell;
  }
  
  @end
  </code></pre>
  
  <p>Every time when I try to scroll the table using the iPhone simulator I have a memory leak of 48k. Do you have any idea where the leak is?</p>