ios编译出错:UIButton.h' has been modified since the precompiled header UIKit.pcm' was built

时间:2022-05-04 09:12:42
今天编译遇到个问题:如下
fatal error: file '/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontDescriptor.h' has been modified since the precompiled header '/Users/m/Library/Developer/Xcode/DerivedData/ModuleCache/24CDWDK5BTYJE/UIKit.pcm' was built
note: after modifying system headers, please delete the module cache at '/Users/m/Library/Developer/Xcode/DerivedData/ModuleCache/24CDWDK5BTYJE'
1 error generated.


解决办法:


进入相应目录删除那个pcm文件:
rm "/Users/m/Library/Developer/Xcode/DerivedData/ModuleCache/24CDWDK5BTYJE/UIKit.pcm"
然后
Clean Project( Cmd+Shift+K) 清除一下工程,重新编译,问题得到解决。