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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:05:18+00:00 2026-05-15T13:05:18+00:00

i´ve created different buttons and initalized them with an array with photos as backgroundImage.

  • 0

i´ve created different buttons and initalized them with an array with photos as backgroundImage.

UIButton* myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[myButton setBackgroundImage:[UIImage imageNamed: (NSString*) obj ] forState:UIControlStateNormal];
[myButton addTarget:nil action:@selector(buttonDown: ) forControlEvents:UIControlEventTouchUpInside];

Here´s my buttonDown-method:

-(void) buttonDown:(UIButton*) sender {
NSLog(@"pressed: %@",   sender.currentBackgroundImage  );}

That traced me that: “pressed: < UIImage: 0x6625c40 >”

Now i want to know how can i get that image-name of any clicked button?
Would be nice to know.Thanks for your time.

  • 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-15T13:05:19+00:00Added an answer on May 15, 2026 at 1:05 pm

    Since UIImage does not store the name of the image it contains, you can’t. You have to store the name elsewhere by yourself in relationship to the Button or image.

    regards

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

Sidebar

Related Questions

I created buttons using a for loop with different tags in objective c, but
i have created six buttons dynamically using initialize function,also i have assigned different id's
I'm trying to create a simple form with two different submit buttons: one which
I have created a button CSS class that uses background images with different positions
I've created 2 different directories on my website as follow my_site.com/boo and my_site.com/koo and
I have a SQL Server table which has 625 columns created with different datatypes
Is there any way to differentiate the child processes created by different fork() functions
I’m building a site that needs users created with different roles and permissions to
We are creating databases on demand and the databases can be created from different
I am currently working on grails project. I have created eight different plugins. Each

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.