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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:48:30+00:00 2026-06-04T12:48:30+00:00

When setting the image for a button, I use stringWithFormat: like so: [buttonImage setImage:[ImgUtil

  • 0

When setting the image for a button, I use stringWithFormat: like so:

 [buttonImage setImage:[ImgUtil image:[NSString stringWithFormat:@"myImage_%d.png", selectNum + 1 ]] ];

I want to inspect that string. I thought maybe I could get the name back from the button:

 if (buttonImage.image == [UIImage imageNamed:@"myImage_2.png"]) {
        NSLog(@"the name of the buttonImage is %@", buttonImage.image);
 }

but that doesn’t work. How can I look at that string?

  • 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-04T12:48:31+00:00Added an answer on June 4, 2026 at 12:48 pm

    If what you want is to “test what the “myImage_%d.png” ends up being” in the following line:

    [buttonImage setImage:[ImgUtil image:[NSString stringWithFormat:@"myImage_%d.png", selectNum + 1 ]] ];
    

    Then I would suggest that you reformat and simplify your code. It will give you the additional advantage of making it easier to read:

    NSString* imageName = [NSString stringWithFormat:@"myImage_%d.png", selectNum + 1 ];
    NSLog(@"imageName is %@", imageName);
    
    [buttonImage setImage:[ImgUtil image:imageName]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My user interface makes use of customized Button s: They contain both an Image
I use uploadify to upload an image. The upload button is a camera image
when setting a default image for bookmarks on the home screen for iOS devices
I am setting a background image on my XAML Grid with a Uri. The
I am displaying image by setting the source of an Image element directly to
I'm setting a custom banner and dialog image for my WiX generated MSI. <WixVariable
Why is this code setting artistImage to an image with 0 width and 0
I am setting up dynamic forum signature images for my users and I want
I'm trying to make a random image appear on the press of a button.
I'm trying to create image from this location : NSString *documentsCacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@Documents];

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.