6

I've started using Xcode 4, and I'm really annoyed by some of the "features" especially those semantic warnings which don't seem to be making much sense, for example:

http://coding-journal.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-07-at-8.50.46-PM.png

On line 640, you can see a semantic issue saying that I am passing an incompatible pointer type to a parameter of NSString *, which is just plain wrong because the signature of NSTabViewItems' initWithIdentifier: is:

- (id)initWithIdentifier:(id)identifier

My guess is that Xcode thinks that I am calling initWithIdentifer: on some other object, because when I Cmd+Click the method, it gives me three options:

http://coding-journal.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-07-at-8.50.24-PM.png

And the first one, from NSTableColumn, has the signature

- (id)initWithIdentifier:(NSString *)identifier;

So my question is, what do I do in this situation? I like my code warning-free, but this doesn't seem to be possible when using Xcode 4 :(

fresskoma
  • 25,481
  • 10
  • 85
  • 128
  • 1
    i have this problem too, really want to know why xcode hates me. – bogardon Mar 29 '12 at 02:00
  • What if you explicitly cast it to id? (id)aTab – Aaron Apr 05 '13 at 21:27
  • 1
    This has happened to me for many Xcode versions now, where Xcode seems to ignore a header and complain about it while in general use, but when I run a build it finds all the symbols and it is fine. I don't know why it complains when builds are fine. Very annoying. – theLastNightTrain Sep 23 '14 at 20:26
  • possible duplicate of [Xcode "Use of undeclared identifier" errors, compiles/runs just fine](http://stackoverflow.com/questions/12150024/xcode-use-of-undeclared-identifier-errors-compiles-runs-just-fine) – Joshua C. Lerner Dec 22 '14 at 02:42

0 Answers0