Always have to clean before building in a mix and match Obj C / Swift project

242 Views Asked by At

I was wondering if someone knows a workaround around this bug in XCode

I have a mix and match Obj C / Swift project.

Always when I am changing the target and then build the project I get errors in the file XXX-Swift.h regarding duplicate interfaces and previous declarations.

Then I have to clean and build again in order for it to work.

Any help appreciated.

1

There are 1 best solutions below

4
On

I'm not sure exactly what is the sequence of events that leads to the errors, but I'm guessing that you are making changes to 'XXX-Swift.h'. This file is generated by Xcode and you should not make changes to it. (Although I would expect Xcode to just re-create it and discard your changes, rather then throwing errors).

Can you show the errors?