Problem Description:

The same set of code works fine in debug mode, but some methods (the ones I encountered were proxy methods) don’t work under Release. (Xcode10.2.1) after a release of a lower version of Xcode, it can run normally.

Cause of the problem:

Proxy method definition to @ objc labels such as @ objc optional func collectionViewExcuteDelete (fadeView: UIView, completion: () – > Void)

Solution:

These proxy methods need to be declared with the @objc tag, otherwise they cannot be called in the release state. @objc func collectionViewExcuteDelete(fadeView: UIView, completion: () -> Void) { print(“ExcuteDelete”) }

Debugging technique

In Xcode, you can switch the operating environment as shown in the figure below