다른 버튼을 만들고 backgroundImage로 사진이있는 배열로 초기화했습니다.버튼에서 backgroundImage의 이름을 가져 오는 방법은 무엇입니까?
UIButton* myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[myButton setBackgroundImage:[UIImage imageNamed: (NSString*) obj ] forState:UIControlStateNormal];
[myButton addTarget:nil action:@selector(buttonDown:) forControlEvents:UIControlEventTouchUpInside];
Here's 내의 buttonDown-방법 :
-(void) buttonDown:(UIButton*) sender {
NSLog(@"pressed: %@", sender.currentBackgroundImage );}
나에게 그 추적 "을 누르면 : <가있는 UIImage : 0x6625c40>"
지금 내가 것을 얻을 수있는 방법을 알고 싶어요 클릭 한 버튼의 이미지 이름? 알아두면 좋을 것입니다. 시간 내 주셔서 감사합니다.
감사합니다. 저는 UIButton의 하위 클래스를 만들고이를위한 새로운 메서드를 추가했습니다. 그 힌트 주셔서 감사합니다 .. – geforce