Xcode 8 Beta 3 使用旧版 Swift 问题 [英] Xcode 8 Beta 3 Use Legacy Swift issue

查看:28
本文介绍了Xcode 8 Beta 3 使用旧版 Swift 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 8 Beta 3 中有一个 Objective-C 项目.自从更新后,每当我尝试构建时都会收到以下错误:

I have an Objective-C project in Xcode 8 Beta 3. Since updating, whenever I try to build I receive the following error:

需要为使用 Swift 的目标正确配置使用旧版 Swift 语言版本"(SWIFT_VERSION).使用 [Edit > Convert > To Current Swift Syntax…] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置.

"Use Legacy Swift Language Version" (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

有人遇到过这种情况吗?由于它是一个 Objective-C 项目,因此没有配置 Swift 的构建设置.我还确保没有任何项目依赖项或 CocoaPods 正在使用 Swift.我唯一的解决方案是使用 Beta 2.有什么想法可以解决这个问题吗?

Has anyone encountered this? Since it's an Objective-C project there's no build setting to configure Swift. I have also made sure none of the project dependencies or CocoaPods are using Swift. The only solution I have is to use Beta 2. Any ideas how I might fix this issue?

我还应该提到我正在运行 OSX 10.12 Beta 2.

I should also mention I'm running OSX 10.12 Beta 2.

推荐答案

我已经忽略这个问题有一段时间了,在此期间只是在处理其他事情 - 我终于找到了我的问题的解决方案.

I have been ignoring this problem for a while now and just working on other stuff in the meantime - I finally found the solution to my problem.

由于我的项目是 Objective-C,我认为我使用的其中一个 Pod 可能使用的是 Swift,我检查了每个 Pod,但没有一个是.

Since my project is Objective-C I figured maybe one of the Pods I am using was using Swift, I checked each Pod and none of them were.

最终的解决方案是我的 Core Data 模型设置为在 Swift 中生成代码,即使我已经在 File > New > NSManagedObjectSubclass 菜单中手动生成它们.我所要做的就是将其切换到 Objective-C.

The final solution was that my Core Data model was set to generate code in Swift even though I have been manually generating them in the File > New > NSManagedObjectSubclass menu. All I had to do was switch it to Objective-C.

这篇关于Xcode 8 Beta 3 使用旧版 Swift 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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