title: Static NSArray of strings - how/where to initialize in a View Controller
body: <p>In a Master-Detail app I'd like to display a TableView with 5 sections titled:</p>
  
  <ol>
  <li>Your Move</li>
  <li>Their Move</li>
  <li>Won Games</li>
  <li>Lost Games</li>
  <li>Options</li>
  </ol>
  
  <p>So I create a blank Master-Detail app in Xcode 5.0.2 and then in its MasterViewController.m (which is a UITableViewController) I'm trying to implement the method:</p>
  
  <pre><code>- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
      return _titles[section];
  }
  </code></pre>
  
  <p><strong>My question</strong> is however how to init the NSArray _titles?</p>
  
  <p>I'm trying in the MasterViewController.m:</p>
  
  <pre><code>#import "MasterViewController.h"
  #import "DetailViewController.h"
  
  static NSArray *_titles_1 = @[
      @"Your Move",
      @"Their Move",
      @"Won Games",
      @"Lost Games",
      @"Options"
  ];
  
  @interface MasterViewController () {
      NSMutableArray *_games;
  
      NSArray *_titles_2 = @[
                           @"Your Move",
                           @"Their Move",
                           @"Won Games",
                           @"Lost Games",
                           @"Options"
      ];
  }
  @end
  
  @implementation MasterViewController
  
  - (void)awakeFromNib
  {
      if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
          self.clearsSelectionOnViewWillAppear = NO;
          self.preferredContentSize = CGSizeMake(320.0, 600.0);
      }
      [super awakeFromNib];
  }
  
  - (void)viewDidLoad
  {
       ....
  }
  </code></pre>
  
  <p>but both tries above give me syntax errors:</p>
  
  <p><img src="https://i.stack.imgur.com/misKY.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>To my surprise there are many suggestions for this simple question, but as an iOS/Objective-C newbie I'm not sure, which solution is most appropriate.</p>
  
  <p><code>dispatch_once</code> - isn't it a runtime operation to execute something once in a multi-threaded app? Isn't it overkill here? I was expecting a compile-time solution for initiating a const array...</p>
  
  <p><code>viewDidLoad</code> - when my app changes between background and foreground, wouldn't it unnecessary initiate my const array again and again?</p>
  
  <p>Shouldn't I better set the <code>NSArray</code> in <code>awakeFromNib</code> (since I use stroyboard scenes for all my ViewControllers)? Or maybe in <code>initSomething</code> (is the correct method <code>initWithStyle</code>?)</p>