0

I updated my xcode 9.4 to 10.1 and swift 3.3 to 4.2. I have the following code in my app, which iterates over a while loop and waits till flag (isReceivedAdTagResponse) becomes true.

while self.isReceivedAdTagResponse == false { continue }

This code works fine in debug mode, but crashes in release mode. Strange is that the same code works in release mode too if I just add print statement.

while self.isReceivedAdTagResponse == false { print("hi") continue }

Somewhere I found the solution to change the "Optimization Level" build setting to None [-O0] and it works.

I want to release the app to the store. Will my app crash if I will keep run mode as debug mode and archive the release build?

Or do I must have to change the "Optimization Level" build setting to None [-O0] before releasing it. Is it a good practice?

I am little confused. Please guide.

Ruchi
  • 411
  • 4
  • 13
  • It has nothing related to debug or release build. It is a very bad idea to "wait" in the loop, even though the .isReceived AndTagResponse is thread-safe. DON'T USE IT!!! NEVER!!! – user3441734 Mar 08 '19 at 15:44
  • I really understand but I am willing to modify it in next release please. Because code is already written and I have to make a release build urgently. please help with the solution. – Ruchi Mar 11 '19 at 05:57

0 Answers0