Xcode 6: How to Disable Optimisation (Swift)

血红的双手。 提交于 2020-01-22 13:30:26

问题


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

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.

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?

SOLUTION:

  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.


回答1:


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



来源:https://stackoverflow.com/questions/27263406/xcode-6-how-to-disable-optimisation-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!