Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accidentally modified an iOS SDK header file, now I cannot compile in simulator

Tags:

xcode

ios

I don't know how I modified a iOS SDK file, but Xcode say I did. Here is what they reported.

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.

I tried to look for this DerivedData but could not. I also went into organizer to delete it and did a clean, even after that, no luck.

How do I restore this UIFontDescriptor.h to its original form?

like image 576
mskw Avatar asked Sep 25 '13 03:09

mskw


People also ask

How do I open a header file in Xcode?

File→Open Quickly: Command-D Pops up a panel where you can type a file name. This is most frequently used for opening header files from the Cocoa frameworks. You can type in a name without an extension and Xcode will first try to find an implementation file and if it can't find one will look for an interface file.

What is header file in Xcode?

The file extensions are pretty much necessary, though, because the build process and Xcode itself rely on them.) The interface section goes into MyClass. h, which is called the header file. The implementation section goes into MyClass. m, which is called the implementation file.


1 Answers

Remove the pcm file

rm "/Users/m/Library/Developer/Xcode/DerivedData/ModuleCache/24CDWDK5BTYJE/UIKit.pcm"

then

Clean Project( Cmd+Shift+K)

Problem solved

like image 164
khanghoang Avatar answered Oct 27 '22 09:10

khanghoang