Duplicate interface declaration for class 'Foo' Duplicate interface declaration for class 'Foo' objective-c objective-c

Duplicate interface declaration for class 'Foo'


I had exactly the same problem. I had two copies of the header and had deleted the old one by deleting the reference to it in Xcode. There was then only one reference of the header which pointed to the new header file in the project navigator.

After actually deleting the old header from the file system, the problem went away.

It could be a bug in Xcode. Maybe sometimes when you delete a reference to a file, part of the reference still remains in the project file.


I have this error message and I don't have the the duplicate header or duplicate imports. The problem is that I've renamed the header file and Xcode somehow keep them cached, that gives the build error.

I did the following to fix this. Hope it helps those that already tried other answer and still got the errors.

  1. Clean project(s)
  2. Delete the "Derived Data" (Organizer > Projects tab, select the project and click Delete)
  3. Restart Xcode
  4. Build


I found the problem. There were two copies of the header file and Xcode got confused.

Now the mystery is how Xcode decided to copy these files by itself ...