title: Objective-C Clarification; -/+ and *var
body: <p>I'm teaching myself Objective-C from a book (<em>Cocoa programming for mac OS X</em>) and am about halfway through however I have two questions that aren't answered or defined in the book.</p>
  
  <ol>
  <li><p>When defining class methods what is the difference between (assuming there in a .h file):</p>
  
  <p>- (int) population;</p>
  
  <p>+ (int) population;</p></li>
  </ol>
  
  <p>The way I see it at the moment is that <code>-</code> methods require the class to be allocated and initialized first however <code>+</code> can be called statically without requiring allocation and initialization. E.g. (in a function in another class)</p>
  
  <pre><code>// Using -
  Earth *world = [[Earth alloc] init];
  int population = [world population];
  
  // Using +
  int population = [Earth population];
  </code></pre>
  
  <p>If that is correct, when should I use static methods and are they're any disadvantages with doing so.</p>
  
  <ol start="2">
  <li><p>When defining a var in either a function paramater or as an actual var in a function, does the use of * mean the var will be an object? e.g. (again in a header file.)</p>
  
  <p>- (void) setPopulation: (NSNumber *) population; //Use of * as population is of NSNumber</p>
  
  <p>- (void) setPopulation: (int) population; // population isn't a class so doesn't need *</p></li>
  </ol>
  
  <p>Sorry if any of my terms don't make sense in the land of Objective-C such as static methods, etc. I'm a PHP and Ruby Programmer.</p>