Xcode 6:如何禁用优化(快速) [英] Xcode 6: How to Disable Optimisation (Swift)

查看:372
本文介绍了Xcode 6:如何禁用优化(快速)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试过程中未触发断点。我发现这是因为代码经过优化。

Breakpoints are not being triggered during debugging. I discovered it's because of optimised code.

如何禁用优化?

我已经遍历了每个工具栏,而我能找到的最接近的选项是产品=>执行动作=>生成优化配置文件

Xcode说,这在我在模拟器中调试时不起作用。

How can you disable optimisation?
I've walked through every toolbar and the closest option that I could find is Product => Perform Action => Generate Optimisation Profile.
This does not work as I am debugging in the simulator, says Xcode.

是吗可以使用模拟器并在Swift中禁用Xcode 6.1中的代码优化功能,如果是这样,我该怎么做?

Is it possible to disable code optimisation in Xcode 6.1 using the simulator and writing in Swift, and if so, how would I go about that?

解决方案:


  1. 在文件夹图标下左窗格的项目导航器中单击您的项目名称。

  2. 点击顶部菜单上的构建设置。

  3. 向下滚动到 Apple LLVM 6.0-代码生成

  4. 在优化级别下,选择无[-O0]

  1. Click your project name in the project navigator in the left pane under the folder icon.
  2. Click 'Build Settings' on the top menu.
  3. Scroll down to 'Apple LLVM 6.0 - Code Generation'
  4. Under 'Optimization Level' Select 'None [-O0]'

我的问题是首先找到构建设置菜单。

My problem was finding the build settings menu in the first place.

推荐答案

在Xcode中,在 Build Settings下找到您的目标,滚动到 Swift Compiler-Code Generation,然后滚动到 Optimization Level。确保选中无。

In Xcode, look under 'Build Settings' for your target, scroll to 'Swift Compiler - Code Generation' and then 'Optimization Level'. Ensure that 'None' is selected.

这篇关于Xcode 6:如何禁用优化(快速)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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