' CloudKit / CKDefines.h'文件未找到

时间:2015-05-28 07:43:25

标签: ios swift cloudkit

目前我正在玩CloutKit并测试本教程:

http://www.raywenderlich.com/83116/beginning-cloudkit-tutorial

在编译期间,我得到了模拟器的以下错误:

#import "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.h:10:9: error: 'CloudKit/CKDefines.h' file not found
#import <CloudKit/CKDefines.h>
        ^
/Users/steve/Downloads/BabiFud-Starter/BabiFud/Establishment.swift:26:8: error: could not build Objective-C module 'CloudKit'
import CloudKit

有趣的是文件CKDefines existes和代码编译为iOS设备。

知道问题是什么吗?

PS:我使用Xcode 6.3.1(6D1002),为应用程序启用了iCloud功能,我清理过几次:) ....

1 个答案:

答案 0 :(得分:0)

该错误听起来像是缺少CKDefines.h文件。如果您有另一个Xcode,可以尝试从旧的Xcode添加CKDefines.h:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CKDefines.h

并将其复制到Xcode-beta版:

/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CloudKit.framework/Headers/

或者在一个命令中(假设在/ Applications /和Xcode.app + Xcode-beta.app:

cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CKDefines.h /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CloudKit.framework/Headers/