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

  • SEARCH
  • Home
  • 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 6788293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:28:07+00:00 2026-05-26T17:28:07+00:00

I have a timer that I use to check a web address every 11

  • 0

I have a timer that I use to check a web address every 11 seconds. I use ASIHTTPRequest to set a delegate which reports the response form the web server. If I get the response I’m looking for, I want to update the UI. Unfortunately this doesn’t work, I suspect because I am not updating the UI from the UI thread.

Code to start and process timer:

- (void)startTimer {
BOOL timerStarted = false;
BOOL running = false;
BOOL readyToProcess = false;

if(!timerStarted){
    running = true;
    timerStarted = true;
    readyToProcess = true;
    autosaveTimer = [[NSTimer scheduledTimerWithTimeInterval:11
                                                      target:self
                                              selector:@selector(processWebCheckTimer:)
                                                    userInfo:nil
                                                     repeats:YES] retain];
}

}

- (void)processWebCheckTimer:(NSTimer*)theTimer {
    if ([VariableStore sharedInstance].success < 1) { //conversion not done, check again
        NSURL *url = [NSURL URLWithString:@"WEBSERVERURLHERE"];
        ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
        [request setPostValue:oc_request forKey:@"queue"];
        [request setRequestMethod:@"POST"];
        [request setDelegate:self];
        [request startAsynchronous];
    }
}

Check response and update UI:

- (void)requestFinished:(ASIFormDataRequest *)request
{
    // Use when fetching text data
    NSString *responseString = [request responseString];
    if ([responseString rangeOfString:@"uccessfully converted"].location != NSNotFound) {
        [self performSelectorOnMainThread:@selector(threadStopAnimatingTwo:) withObject:nil waitUntilDone:YES]; //DOESNT WORK
        [autosaveTimer invalidate];

    }   

}

Function to Update UI:

- (void) threadStopAnimatingTwo:(id)data {
    NSLog(@"stop animating two");
    [loadingTwo stopAnimating];
    [labelTwo setTextColor:[UIColor lightGrayColor]];
}
  • 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-26T17:28:07+00:00Added an answer on May 26, 2026 at 5:28 pm

    It turns out that I was creating a new instance of my View controller when I didn’t need to. Because I created a new instance of the view controller, [self.loadingTwo] referred to a null UI component.

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

Sidebar

Related Questions

I have a timer that ticks every 3 seconds. If the timer found something
I have a winform app that calls a web service to check for updates.
I have written a web app in PHP which makes use of Ajax requests
I have an Ajax request to a web service that typically takes 30-60 seconds
We have several ASP.NET applications that use a sitemap which is populated via a
I have a timed page that I need to use to submit a form
i have this crazy label for each time i create a migration that use
I have a webpage that I use h1 tags multiple times within various DIVs
I have a specific question, that could use a general answer... When building Multi-Tier
It's Friday refactor time!!! I have an object that I use to generate SQL

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.