title: Objective C - loop to change label text
body: <p>i have a loop that looks like this</p>
  
  <pre><code>for(int x=0; x &lt; 10; x++){
      [testLabel setText:[self randomString]];
      sleep(1);
  }
  </code></pre>
  
  <p>The randomString is a method where it returns a random string from an array.</p>
  
  <p>I'm using sleep so it is actually possible to see the label being changed. </p>
  
  <p>The loop works fine but the label only gets updated after the last iteration from the loop.</p>
  
  <p>Does anyone know why this could be? And would there be a way to fix it?</p>