First of all, an interesting question!
Xcode uses gcc output to create a list of warnings and errors and some other (internal) mechanism to create a list of autocomplete suggestions. Autocomplete is smarter sometimes (and sometimes not, you know :)
But why gcc does not warn? You already have an answer - alloc returns id .
My answer is not a "response", but I want to share the following with you. (Sorry, I don't have a Mac for a moment, so this is not Apple objective-c)
shum@shum-laptop :/tmp/shum$ cat test.m
There are no warnings. But try to comment on - (id) blah in Test1 interface
shum@shum-laptop :/tmp/shum$ gcc test.m -lobjc test.m: In function 'main': test.m:24: warning: no '-blah' method found test.m:24: warning: (Messages without a matching method signature test.m:24: warning: will be assumed to return 'id' and accept test.m:24: warning: '...' as arguments.) shum@shum-laptop :/tmp/shum$
We can conclude: if you overclock with an init call and there is no selector with the same name, gcc should warn you; in a bad case, when a selector with the same name exists somewhere, gcc will not warn you. I don't have a Mac or Xcode for a moment, could you test it?
[EDIT] Just tested it with xcode. The same behavior.
Yuras source share