I was working on my project and suddenly after editing the code and compiling gave this error:
ld: warning: directory not found for option \'-
L/Use
The only way we can get past this bug on our project is to do a Clean and then build for iPad Retina. After that it will build successfully for any device. Weird.
If this happens to you with CoreData generated classes, combine the +CoreDataProperties and +CoreDataClass into the +CoreDataProperties class and delete the +CoreDataClass. Make sure to search Derived Data for leftovers of the +CoreDataClass. Even after deleting the Derived Data and cleaning I sometimes had Xcode just generate the +CoreDataClass again and again. Deleting it manually in Finder and then re-bulding helped me solve this.
I was importing a library in a test case which I had specified in my pod file for the main target but not for the test target.
Faced similar issue, while running the code on a simulator, tried all the above mentioned options, still got the same error. Tried connecting the iOS device and build the code, it worked for us. This can be a quick workaround.
I tried several of the answers listed but none worked for me. I got the error after updating XCode (while it was still open which may have contributed to the problem)
First, I deleted my Derived Data folder: XCode => Preferences => Locations => Double Click on arrow next to path indicating where the Derived Data folder is. Then "Move to Trash" I don't think that's what the problem was, but it's amazing how many times this has been an issue for me working on different problems.
Second, I 'Quit' the simulator.
Third, I 'Quit' XCode.
Fourth, I opened up my project in XCode again and then did a Clean and Build (found in the Product menu)
Fifth, I ran my project and it worked fine
In case this comes in useful for anyone else--I just had this same error, and turns out the cause was initializing a variable in my header file rather than in the main file.