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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…