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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:57:21+00:00 2026-05-15T12:57:21+00:00

I want to load an image from an array and set the view to

  • 0

I want to load an image from an array and set the view to display this image.

The current code isnt loading anything, just a gray image full screen.

myView.image = [UIImage imageNamed:[names objectAtIndex:r]]

If I have a counter r, which I use to access the index. How could it be done to load an image as such

myView.image = [UIImage imageNamed:@"3.png"];

but using r as the placeholder for the number, in this case 3.

If I have images 1.png to e.g. 10.png and want to use the r which I already increment and decrement, ow could I call the correct image using a formatted string in the place of

@”3.png” ?

Thanks in Advance.

  • 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-15T12:57:22+00:00Added an answer on May 15, 2026 at 12:57 pm

    You can do:

    myView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load the image URL from my NSMutableArray. Here is my Code:
Because I want to do things like load images from the web (see this
I want to load a image to UIImageView from my app documents library. I
I want to load an image from an external folder of my system to
I want to load array of Images one by one from drawable. At a
I want to load some images into my application from the file system. There's
I want to load 52 images (deck of cards) in gif format from my
I Want to load Image size 2550X3300 (i.e 1.7 Mb size), i have loaded
I want to load an image, resize it to a given size and after
i want to load some photos into my sd card image in the emulator.

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.