title: iOS - Memory allocation - using the same variable to build an array
body: <p>I've been reading some tutorials on raywenderlich.com, and came across this block of code...</p>
  
  <pre><code>_players = [NSMutableArray arrayWithCapacity:20];
  
  Player *player = [[Player alloc] init];
  player.name = @"Bill Evans";
  player.game = @"Tic-Tac-Toe";
  player.rating = 4;
  [_players addObject:player];
  
  player = [[Player alloc] init];
  player.name = @"Oscar Peterson";
  player.game = @"Spin the Bottle";
  player.rating = 5;
  [_players addObject:player];
  
  player = [[Player alloc] init];
  player.name = @"Dave Brubeck";
  player.game = @"Texas Hold’em Poker";
  player.rating = 2;
  [_players addObject:player];
  </code></pre>
  
  <p>Even if the project is using ARC, isn't this bad code? Re-allocating and initialing the variable? Shouldn't it be allocated once and then reference a method within the class that prepares the variable for reuse by wiping the existing data?</p>