1. 程式人生 > >iOS錯誤之---fatal error: could not build module 'UIKit'

iOS錯誤之---fatal error: could not build module 'UIKit'

在使用Xcode時,有時會出現一下錯誤提示:
fatal error: file ‘/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h’ has been modified since the precompiled header ‘/Users/imac/Library/Developer/Xcode/DerivedData/ModuleCache/1M29HZNHW3I5B/UIKit-2M4VYLEDI34V0.pcm’ was built

解決辦法是:刪除以上標記的’/Users/imac/Library/Developer/Xcode/DerivedData/ModuleCache/1M29HZNHW3I5B/UIKit-2M4VYLEDI34V0.pcm檔案。

刪除之後好有可能出現fatal error: could not build module ‘UIKit’錯誤提示, 辦法是刪除/Users/imac/Library/Developer/Xcode/DerivedData/ModuleCache資料夾,重新編譯、執行方可。

注意:imac下的Library(資源庫)一般都隱藏啦,
進入終端,輸入chflags nohidden ~/Library/就可以了。