Xcode: Cannot set optimization level for debug

2019-09-13 01:15发布

问题:

I can't add it and there's no debug optimization, yet I got the log:

ProjectName was compiled with optimization - stepping may behave oddly; variables may not be available.

More info: I went to the edit build scheme and it's set as debug mode.

回答1:

It looks like you've accidentally deleted your debug configuration. To prove this to yourself, look at your project's Info pane. You should see this — but I'm betting you won't:

A configuration is just a name, so you can easily recreate the debug configuration right here in the project settings; but that won't magically restore all the corresponding default build setting values. Your best bet is to consider this project hosed: make a new project, to get the template's values for the build settings, and migrate everything from this project into it.