title: Factory (design pattern) in Objective C
body: <p>I'm trying to create a factory (design pattern) in Objective C
  So I'm doing something like:    </p>
  
  <pre><code>+ (Car *)createCar:(int)color {
      if (color == 1) {
          return [CarFactory createBlueCar];
      } else if (color == 2) {
          return [CarFactory createRedCar];
      } else {
          return nil;
      }
  }
  
  + (Car *)createBlueCar {
      // ...
  }
  
  +(Car*)createRedCar{
      // ...
  }
  </code></pre>
  
  <p>However I don't want the <code>createBlueCar</code> and the <code>createRedCar</code> to be available to public and if I don't define them in the <code>.h</code> file then I get a warning of the missing definition.</p>
  
  <p>I'm a former Java developer and a newbie in Objective-C — So it might be just bad practice If so what the be good practice of doing so.</p>