title: Xcode doesn't warn for invalid init methods
body: <p>I just noticed that if you try to call a non-existing init method on the same line as an alloc statement, XCode will not warn you about this.</p>
  
  <pre><code>NSString *string = [[NSString alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
  UIView *view = [[UIView alloc] initWithCapacity:0];
  </code></pre>
  
  <p>No warnings for either of those lines of code. Now, I guess this is because "alloc" actually returns id, as opposed to a static type. However, when I start to type "init," XCode gives me autocomplete options that only include init methods for the correct type. So, if is it using my static typing at the start of the line to give me autocomplete options, why isn't it also using that to give me a warning? Is this a setting somewhere in XCode that could be turned on?</p>
  
  <p>Obviously it doesn't matter as much for obviously wrong things like those examples, but for some objects, this can cause runtime errors due to typos or forgetting to change one thing when you change another thing. I could also get a compiler warning by separating the alloc and init methods into 2 different lines of code, but I have never seen this done; I have always learned to use one line of code for alloc and init.</p>