xCode斷點調試正常工作中都會遇到,如果遇到循環次數較多的情況,其實我們可以通過設置斷點條件來實現:
代碼:
<pre><code>for i in 0...30 { print("索引---\(i)") }
</code></pre>
FlyElephant.png
測試結果:
<pre><code>(Int) $R0 = 21 FlyElephant 索引---21 (Int) $R1 = 22 FlyElephant 索引---22 (Int) $R2 = 23 FlyElephant 索引---23 (Int) $R3 = 24 FlyElephant 索引---24 (Int) $R4 = 25 FlyElephant 索引---25 (Int) $R5 = 26 FlyElephant 索引---26 (Int) $R6 = 27 FlyElephant 索引---27 (Int) $R7 = 28 FlyElephant 索引---28 (Int) $R8 = 29 FlyElephant 索引---29 (Int) $R9 = 30 FlyElephant
</code></pre>