Today, when I used xcode to compile the project, I encountered an inexplicable problem: cocould not build module 'Foundation ', cocould not build module 'uikit', nsstring. h. CT identifier problem. The prompt location is in the pod library. After several queries, I found myself careless...
When this problem occurs, it is found that there is no problem with the compilation of the real machine, and a similar problem is prompted when compiling other projects. The most important thing is that nsstring is prompted during compilation of a simple project. h else CT identifier problem, suddenly alert don't I accidentally put nsstring. h modified? Because in the morning, I did open the nsstring. h file.
However, I couldn't find the correct location from the prompts, so I found a clean nsstring on another computer. h file, with the native nsstring. the H file is compared and the problem is found: I deleted the astring IN THE-(nsange) rangeofstring :( nsstring *) astring; line ..
I said that you should also add a read-only permission to the database file, which makes me struggle for a long time. However, I am lucky to uninstall and reinstall xcode.
Nsstring. h file path:/applications/xcode. APP/contents/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator. SDK/system/library/frameworks/Foundation. framework/headers/nsstring. h
Possible causes summarized by others:
Possibility 1: C, C ++, and OC compatible. Just modify the method of stackoverflow on the upper floor. PCH, or set the OC to OC ++ in build parse.
Possible 2: According to the error prompt, there is a lack of @ end or). The Compiler detects the resulting error and strikes around the last 20. For details, see too internal error emitted...
Possibility 2: The uikit library is damaged or modified (it seems that the ios5 or above cannot be modified, but it will be broken if changed)
Solution 1: You can delete modulecache, which is also a common practice on the Internet.
Solution 2: No matter whether I delete modulecache multiple times on the local machine, it will be invalid. Finally, I asked my students to get a. h file (suspected to be modified) And then I will be revived with full blood!
In the end, I can't do it. I just need to delete xcode completely. Remember to do it completely, instead of taking the garbage bin directly. There are many online tutorials and reinstalling one.
Remind me to delete modulecache and use the clean and reset simulators.
I guess the last one is to completely delete xcode because it accidentally modified the library file.
Refer:
Inexplicable error: cocould not build module 'Foundation'
Cocould not build module 'Foundation 'in xcode 6
Xcode 5.0.2 cocould not build module "Darwin"
xcode has some inexplicable problems. cocould not build module 'Foundation '