找不到Xcode6'Foundation / Foundation.h'文件

使用Xcode6-Beta,我无法编译代码在我的iOS7.1设备上运行。 我得到这样的错误:

While building module 'UIKit' imported from /Users/johnboiles/Programming/iOS/Playground-ios/Playground-ios/AppDelegate.h:9: fatal error: 'Foundation/Foundation.h' file not found #import <Foundation/Foundation.h> ^ In file included from /Users/johnboiles/Programming/iOS/Playground-ios/Playground-ios/AppDelegate.m:9: /Users/johnboiles/Programming/iOS/Playground-ios/Playground-ios/AppDelegate.h:9:9: fatal error: could not build module 'UIKit' #import <UIKit/UIKit.h> ~~~~~~~^ 

有趣的是, Foundation.framework其实/Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks就像它在以前的版本中一样Xcode中。 我没有(至less在知识上)修改了SDK中的任何东西。

删除并重新安装Xcode6-Beta修复了这个问题。

如果有人对Foundation.framework发生了什么有深入的了解,我很乐意听到。

Product->Clean为我做了诡计

我做了以下步骤,一切都恢复正常。

  1. 重新安装当前的Xcode
  2. 在Xcode第一次启动时, Shift + Command + K清除以前的版本
  3. 等到索引完成。
  4. 重新构build。