title: Objective-C - Where are class instances declared?
body: <p>I'm making a program using Objective-C (Xcode) and I need to be able to make an instance of another class.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      currentSide = 0;
      [self loadStage];
      Cube *cube = [[Cube alloc] init];
  }
  </code></pre>
  
  <p>I wanted to make an instance of Cube as soon as the first Viewcontroller loads, but when I make it there, no other methods can access it.</p>
  
  <p>I'm brand new to Obj-C but as I understand it, Viewcontroller.m should not have a main method in it, as this is in the main.m file. So where should class instances be made?</p>
  
  <p>I bet I'm missing something obvious. Thanks in advance.</p>