Xcode 6:如何禁用优化(快速) [英] Xcode 6: How to Disable Optimisation (Swift)
问题描述
在调试过程中未触发断点。我发现这是因为代码经过优化。
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?
解决方案:
- 在文件夹图标下左窗格的项目导航器中单击您的项目名称。
- 点击顶部菜单上的构建设置。
- 向下滚动到 Apple LLVM 6.0-代码生成
- 在优化级别下,选择无[-O0]
- Click your project name in the project navigator in the left pane under the folder icon.
- Click 'Build Settings' on the top menu.
- Scroll down to 'Apple LLVM 6.0 - Code Generation'
- 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屋!