Xcode 6 Beta:没有这样的模块“Cocoa" [英] Xcode 6 Beta: No such module 'Cocoa'
问题描述
我正在尝试在 Xcode 6 Beta 的 swift 文件中使用标准 Cocoa 库.我跟着 这个说明但是当我导入库时
I'm trying to use the standard Cocoa library in a swift file in Xcode 6 Beta. I followed this instructions but when I import the library
import Cocoa
XCode 抱怨错误
No such module 'Cocoa'
我也尝试过 REPL,我完全没有问题.我想这是一个错误,因为我开始了不同的项目,只是有时我会遇到这个错误.有什么建议?我正在使用小牛队 (10.9.3)
I also tried with the REPL and I have no problems at all. I suppose it's a bug, cause I started different projects and only sometimes I get this error. Any suggestions? I'm using Mavericks (10.9.3)
推荐答案
您不能从 iOS 游乐场或应用程序import Cocoa
.确保您的代码在 Cocoa playground 中运行(在新文件对话框中选择 OS X > 源).
You can't import Cocoa
from an iOS playground or application. Make sure your code is running in a Cocoa playground (select OS X > Source in the new file dialog).
这篇关于Xcode 6 Beta:没有这样的模块“Cocoa"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!