title: Mismatched -init method names
body: <p>I discovered an odd scenario that produces a compiler warning in XCode that I don't believe is a valid warning.</p>
  
  <p>As an example I created two classes, ClassA &amp; ClassB, that both have an init method called -initWithSomething:
  One takes an (NSDate *) as the "something" and the other takes (NSString *)</p>
  
  <p><strong>Class A</strong></p>
  
  <pre><code>// ClassA.h
  #import &lt;Foundation/Foundation.h&gt;
  
  @interface ClassA : NSObject {
  }
  -(id)initWithSomething:(NSDate *)something;
  @end
  
  // ClassA.m
  #import "ClassA.h"
  
  @implementation ClassA
  -(id)initWithSomething:(NSDate *)something {
      if (self = [super init]) {
      }
      return self;
  }
  @end
  </code></pre>
  
  <p><strong>Class B</strong></p>
  
  <pre><code>// ClassB.h
  #import &lt;Foundation/Foundation.h&gt;
  
  @interface ClassB : NSObject {
  }
  -(id)initWithSomething:(NSString *)something;
  @end
  
  // ClassB.m
  #import "ClassB.h"
  
  @implementation ClassB
  -(id)initWithSomething:(NSString *)something {
      if (self = [super init]) {
      }
      return self;
  }
  @end
  </code></pre>
  
  <p><strong>Implementation of another class that uses both ClassA &amp; ClassB</strong></p>
  
  <pre><code>#import "ExampleClass.h"
  #import "ClassA.h"
  #import "ClassB.h"
  
  @implementation ExampleClass
  
  -(void)doSomething {
      NSDate *date = [NSDate date];
      NSString *string = [NSString stringWithFormat:@"Test"];
  
      ClassA *classA = [[ClassA alloc] initWithSomething:date];
      ClassB *classB = [[ClassB alloc] initWithSomething:string]; // Produces "Incompatible pointer types sending 'NSString *' to parameter of type 'NSDate *'
      ClassB *classB2 = [[ClassB alloc] initWithSomething:[NSString stringWithFormat:@"Test"]]; // Does NOT produce a warning
      ClassB *classB3 = [[ClassB alloc] initWithSomething:@"Test"]; // Produces the same warning as above.
  
      [classA release];
      [classB release];
      [classB2 release];
      [classB3 release];
  }
  </code></pre>
  
  <p>Is this a compiler bug?  Doesn't seem like either of those lines should produce a warning, especially since the line where "classB2" is initted produces no warnings.<br>
  This code actually works fine, the correct class' -initWithSomething: is called and passed the appropriate type of argument.</p>
  
  <p>Clearly, more explicit method names will avoid the issue but I'd like to know why the compiler isn't able to handle this.</p>
  
  <p><strong>Note</strong>:
  I should add that this only seems to occur with -init methods, any other instance or class functions do not seem to produce the warning. </p>