在 10.9 上编译 Swift? [英] Compile Swift on 10.9?

查看:16
本文介绍了在 10.9 上编译 Swift?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到今天下午,当我下载了最终的 Xcode 6 时,我才能够在我的 10.9 机器上玩 Swift.现在我收到此错误:

Until this afternoon, when I downloaded the final Xcode 6, I was able to play around with Swift on my 10.9 machine. Now I get this error:

OS X targets using Swift cannot be built against an SDK older than 10.10, but the effective SDK is 10.9.

我已经保存了我的 Xcode 6B7 副本,但现在在该版本中打开项目也会导致相同的错误.

I had saved my copy of Xcode 6B7, but now opening the project in that version also causes the same error.

有大佬解决吗?我不想在这台机器上安装 10.10.

Anyone have a fix? I do not want to install 10.10 on this machine.

推荐答案

好的,这里是独家新闻:

Ok, so here's the scoop:

下载 GM 后,您将拥有一个不起作用的 Xcode,Apple 忘记将 sdk 包含在应用程序包中.所以现在你还必须下载 6.1 测试版,显示包内容,然后转到文件夹:

After downloading the GM you will have a non-functional Xcode, Apple forgot to include the sdk in the app bundle. So now you have to download the 6.1 beta as well, Show Package Contents, and go to the folder:

/Volumes/Xcode/Xcode-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer

注意我已经从磁盘映像打开了应用程序包,因此是卷名.在那个 SDKs 文件夹中,您会找到 MacOSX10.9.sdk 和 MacOSX10.10.sdk.GM 版本缺少后者.所以在方便的地方复制一份,比如你的桌面.

Note I have opened the app bundle from the disk image, thus the volume name. Inside that SDKs folder you will find MacOSX10.9.sdk and MacOSX10.10.sdk. The GM release is missing the later. So make a copy of that somewhere handy, like your desktop.

好的,现在在GM版中找到相同的路径.我的安装在我的应用程序文件夹中,所以它在这里:

OK, now find the same path in the GM version. Mine's installed in my Applications folder, so it's here:

/Applications/Xcode 6.app/Contents/Developer/Platforms/MacOSX.platform/Develope

您会注意到 MacOSX10.10.sdk 文件夹丢失了.好的.好的,将测试版中的版本复制到此文件夹中.

You will note that the MacOSX10.10.sdk folder is missing. Nice. Ok, copy the version from the beta into this folder.

重启 Xcode,打开你的项目并清理.现在非常仔细地查看每个 SDK 或部署目标的设置.SDK 必须是 10.10,部署目标必须是 10.9.这出现在多个屏幕的许多地方,所以仔细查看.

Restart Xcode, open your project and Clean. Now look VERY CAREFULLY for every setting for SDK or deployment target. The SDK has to be 10.10, the deployment target has to be 10.9. This appears in many places on several screens, so look carefully.

编译并运行.并修复了我在 B6 和 B7 的 Xcode 中看到的崩溃.

Compiles and runs. And fixes the crashes I was seeing in Xcode in B6 and B7.

这篇关于在 10.9 上编译 Swift?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆