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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:40:26+00:00 2026-05-22T15:40:26+00:00

I have a thread which performs some tasks. At the end I want to

  • 0

I have a thread which performs some tasks.

At the end I want to run a selector to hide an image with animation.

[self performSelectorOnMainThread:@selector(finishUpdate) withObject:nil waitUntilDone:YES];

I am setting the duration to 10 seconds:

- (void) finishUpdate {

    UIImageView *myImage = (UIImageView *)[self.view viewWithTag:788];

    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:10.0f];
    myImage.frame = CGRectMake(0, 200, 320, 80);
    myImage.alpha = 0.0f;
    [UIView commitAnimations];
}

But it is disappearing instantly and the thread continues immediately.

Do you know how to make my thread to wait or how to display this simple animation?

  • 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-22T15:40:27+00:00Added an answer on May 22, 2026 at 3:40 pm

    Instead of waiting for the selector to finish, I used sleepForTimeInterval: method to pause my thread, using the same duration as my animation.

    [NSThread sleepForTimeInterval:0.3];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this thread which run as a service: public void run() { try
I have a parent thread (non-UI) which creates some child threads to do some
I have a class which extends the Runnable . This class performs some heavy
I have a thread which handles all the HTTP Connections to the server and
I have thread exception handler which saves the exception stack trace and should close
I have an application where i have created a thread which must check the
I am building an application in swt, I also have a thread running which
I have the main thread from which I start a window using invokeLater .
I have a thread pool (executor) which I would like to monitor for excessive
I have created a GUI for starting a Thread which does something very simple.

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.