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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:02:53+00:00 2026-06-07T13:02:53+00:00

So I have an iOS5 application (xcode 4.2) where I have a viewcontroller with

  • 0

So I have an iOS5 application (xcode 4.2) where I have a viewcontroller with a UIImageView set to a certain image. I would like to change this image to another image after 2 seconds. There is no user interaction, and the only thing that needs to happen is for the image to change after 2 seconds. I found information on dispatch_time, so I tried that.

If you type dispatch_time in main.m, it gives you a few lines of code and you need to insert what it should do after 2 seconds. My questions:

  1. Is the dispatch_time code indeed meant to go in main.m ? Assume that this application does nothing else than change the UIImageView to display another image after 2 seconds.

  2. How do I reference the UIImageView from main.m? The declaration in the view controller .h file is like this:

    @property (weak, noatomic) IBOutlet UIImageView *Image;

  • 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-06-07T13:02:55+00:00Added an answer on June 7, 2026 at 1:02 pm

    Use the dispatch code in your view controller, probably in viewDidLoad:

    - (void)viewDidLoad {
        ...
    
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2.0 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
            self.Image.image = [UIImage imageNamed:@"anotherImage.png"];
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our iOS application with three UIViewController s one after another, we would like
I have created a page-based application in Xcode 4, for iPad iOS5. When I
So basically i have upgraded to iOS5 and xcode 4.2 but after a little
I am developing an image processing application in ios5. In this application I want
I am developing an application for ios 5.1. I have now set up push
I have a little iOS5 app that shows images. I click on the image
IOS5.1 / XCode 4.3 I have 2 entities in my core data, lets call
I have a UITableView in an iOS5.1 app where I set self.tableView.allowsMultipleSelection=YES; The Apple
I have an Xcode 4.2 project with ios5 targeting 4.3 and am now suddenly
I have updated my iPod to iOS5 and xcode to 4.2 but none of

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.