S'rCat
S'rCat

Reputation: 638

Xcode breakpoints: break on string compare

I can do conditional breaks in Xcode using string compare?

something like: theLabel.text.range(of:"4") != nil

Upvotes: 1

Views: 1766

Answers (1)

matt
matt

Reputation: 535606

You are describing a conditional breakpoint. Double-click the breakpoint marker and enter the expression you want evaluated. You will break only if the expression is true.

Be sure to test your expression in code, first, to make sure it is valid. In your case, you need to remember that text is an Optional:

enter image description here

Upvotes: 2

Related Questions