Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6016617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:00:31+00:00 2026-05-23T03:00:31+00:00

I have a method with a for() loop. In that loop, mylabel.text is updated

  • 0

I have a method with a for() loop. In that loop, mylabel.text is updated many times. However, the actual label does not update on the screen until the method is done, updating with the last value created in the for() loop.

Using an NSLog, which does update in the middle of the for() loop, I see the value indeed changing for the label many times.

Is it the general practice in iOS to not update labels in the middle of the for() loop? I would imagine there is a way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:00:31+00:00Added an answer on May 23, 2026 at 3:00 am

    You can make the UI update by telling the run loop to run like this:

    for (NSInteger i = 0; i < 10; i++) {
        [label setText:...];
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that performs a loop on a separate thread. For reasons
I have a foreach loop that starts a process within a try/catch. In the
I have a method inside of a method. The interior method depends on a
I currently have a class that sets the current time when an object has
In short, I'm utilizing C# to scientific computation and I've written a method that
I have two files: 1- with 1400000 line or record --- 14 MB 2-
I have an image updater. I am loading by JSON the exact same file/partial
I have a form with 2 controls on it. Control 1 has several search
I'm working on a Windows application that's written in VBScript and I need to
Given two IEnumerable s of the same size, how can I convert it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.