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 4096568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:03:47+00:00 2026-05-20T20:03:47+00:00

In my iPhone application, I have a secondary thread that I have made for

  • 0

In my iPhone application, I have a secondary thread that I have made for performing tasks in the background, and every few milliseconds, the view must be updated (not from the main thread). I have tried the following code in my UIView subclass:

 [self performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:NO];

That works great on the simulator, however, on my device, it is very laggy. The only thing I can think of is that the main thread is bogged up with the usual routines of the UIKit, meaning my setNeedsDisplay gets called long behind when it is supposed to (about 1/2 sec later). I think this because in other code, based off of user interaction, I call setNeedsDisplay right away, and it works fine without any lag at all. There are less backend computations on the secondary thread than there is on the user interface thread. This leads to some very bad visual effects in my application.

So, to sum things up, How can I fix this problem?


UPDATE:

Is there another way for me to tell a view it needs to refresh itself x times a second? that could end up being better performance for me, if that is possible. I have tried CADisplayLink with no success…

  • 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-20T20:03:47+00:00Added an answer on May 20, 2026 at 8:03 pm

    If your UI is getting hit so hard that your call is getting delayed that much, try batching up the UI updates a little and/or doing beginUpdate/endUpdate around batches of TableView updates (for example.)

    I am doing something similar in MonoTouch, and I’m not seeing any lag of that magnitude. All my updates are from background threads in the same manner as your app.

    Alternatively if your main UI could use some more CPU time, try lowering the background thread priorities and see if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPhone application I have a table view. When user taps any row,
I have created an iPhone application based on an OpenGL view. Now I would
I have an iPhone application with a settings.bundle that handles various settings for my
I have an application that works some what similar to how iPhone's Contact application
I currently have an iPhone application that makes a call to an API to
I have an iPhone application that has a user preference page where the user
I have an iPhone application where i'm showing a settings page using modal view
I have worked on iPhone application but not aware of the formalities to submit
I have a webview in my iPhone application, and I also have some html
Does anyone have any suggestions as to how to version an iphone application aside

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.