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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:47:08+00:00 2026-05-28T05:47:08+00:00

I have the variant of the following codes, triggered by a user input. NSLog(@WHY

  • 0

I have the variant of the following codes, triggered by a user input.

NSLog(@"WHY YOU iOS!!!");
[scanButton setSelected:YES];
[overlayImageView setImage:image];
[overlayView setHidden:YES];

The thing is that the above routine executes with seemingly random delay from five seconds to more than a minute.

Sometimes, they don’t execute at all, except, mysteriously, the NSLog method. If I set a breakpoint at the NSLog line, it just executes immediately and I can see “WHY YOU …” printed out in the console. However, even though the debugger runs smoothly past the below three lines without errors or warnings, the effect of the the next three lines takes place after random delay, or infinite delay. What’s wrong? How could it be possible that they have random delay?

I suspected that UI part of Cocoa SDK suspends due to my poor program design or whatever, but even during the random delay, other buttons and functionalities work so fine, while the effect of setImage takes place suddenly in 47.2 seconds. What’s wrong with iOS, or with me?

What confounds me more is that the above exact routine works fine without delay if the image parameter (UIImage*) comes from a different source. If that’s the case, we can attribute the cause of the problem to the image, however, why do scanButton and overlayView also respond with the same delay, even though they have nothing to do with the image? Total mystery to me.

  • 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-28T05:47:09+00:00Added an answer on May 28, 2026 at 5:47 am

    I have no idea on whats going on, as there is almost no hint in the code that you’ve provided, but why you dont try something like this:

    dispatch_async(dispatch_get_main_queue(), ^{
    
            NSLog(@"WHY YOU iOS!!!");
            [scanButton setSelected:YES];
            [overlayImageView setImage:image];
            [overlayView setHidden:YES];
    
            [overlayImageView setNeedsDisplay];
            [overlayImageView setNeedsLayout];
    
            [scanButton setNeedsDisplay];
            [scanButton setNeedsLayout];
    
            [overlayView setNeedsDisplay];
            [overlayView setNeedsLayout];
    
    });
    

    Basically ensure always to update de UI in the main thread (in case that you’re using a background thread) and set the UI controls as needed to be redrawn.

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

Sidebar

Related Questions

I have the following code: typedef boost::variant<LandSearchParameter, WaterSearchParameter> SearchParameter; enum Visibility{ CLEAR, CLOUDY, FOG,
I have two following domains: User { UserData userData } UserData { static belongsTo
I have a variant for initializing DbRecordData public class DbRecordData : IList<DbFieldValue>, ICollection<DbFieldValue>, IEnumerable<DbFieldValue>,
If I have a variant array which holds nothing but simple types, and possible
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Given a variant, does VBScript have an equivalent of C#'s DateTime.TryParse method?
I have several domain names registered, each a slight variant of each other. E.g,
I'm looking for a variant of the STL (it's okay if it doesn't have
I have the following bit of code: $query = SELECT * FROM jos_vm_product_details WHERE
I have the following that I execute inline on a number of screens: tinyMCE.init({

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.