简体   繁体   中英

Xcode breakpoints: break on string compare

I can do conditional breaks in Xcode using string compare?

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

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:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM