Use of undeclared identifier ‘someObj’

The message “Use of undeclared identifier ‘someObj'” just means Xcode does not know what this class is. i.e. you’ve forgotten to import the header. E.g.

<pre brush=”c”>

#import “MyClass.h”
MyClass *someObj = [[MyClass alloc] init];

This is a very common problem – both from forgetting to import your header or Apple’s headers. It can also appear if you’ve misspelled the class name.

Leave a Reply

Your email address will not be published. Required fields are marked *