title: Initialize properties in Singletons in objective-c
body: <p>So I'm kind of unsure about something.  What I want is one class to know about the data through all my different view controllers.  This one class should have an array of my objects so that if I have a detailViewController, I would just be looking at one instance in my array that the DataManager would hold.  I thought that this DataManager would be a singleton.  I followed Apple's documentation on creating a singleton, but now I'm a bit confused on the properties.  </p>
  
  <pre><code>static DataManager *sharedDmgr = nil;
  + (id)sharedInstance {
      if (sharedDmgr == nil) {
          sharedDmgr = [[super allocWithZone:NULL] init];
      }
      return sharedDmgr;
  }
  </code></pre>
  
  <p>If I want an NSMutableArray property, what is the proper way to initialize it?  Do I do something like</p>
  
  <pre><code>+ (id)sharedInstance {
      if (sharedDmgr == nil) {
          sharedDmgr = [[super allocWithZone:NULL] init];
          [self sharedInit];
      }
      return sharedDmgr;
  }
  
  - (void)sharedInit {
        // initialize all my properties for the singleton here?
  }
  </code></pre>
  
  <p>Thanks!</p>