내가 UIButton
이미지를 변경하기 위해이 일을하고 변경하지 않고, 여기에 모든 "스위치"는목표 - C가 :있는 UIButton 이미지
-(IBAction)userselect:(id)sender
{
UIButton *btnTagcatcher =(UIButton *)sender;
if(btnTagcatcher.tag == 1)
{
if(btnimgflag1 == 0)
{
NSString* path = [[NSBundle mainBundle] pathForResource:@"check-box-withtick-1n1"
ofType:@"png"];
UIImage *image = [[UIImage alloc] initWithContentsOfFile:path];
[switch1 setImage:image forState:UIControlStateNormal];
NSString* path1 = [[NSBundle mainBundle] pathForResource:@"check-box-withouttickn1"
ofType:@"png"];
UIImage *image1 = [[UIImage alloc] initWithContentsOfFile:path1];
[switch2 setImage:image1 forState:UIControlStateNormal];
[switch3 setImage:image1 forState:UIControlStateNormal];
[switch4 setImage:image1 forState:UIControlStateNormal];
btnimgflag2 = 0;
btnimgflag3 = 0;
btnimgflag4 = 0;
btnimgflag1 = 1;
}
else if(btnimgflag1 == 1)
{
NSString* path = [[NSBundle mainBundle] pathForResource:@"check-box-withouttickn1"
ofType:@"png"];
UIImage *image = [[UIImage alloc] initWithContentsOfFile:path];
//[switch1 setImage: image];
[switch1 setImage:image forState:UIControlStateNormal];
btnimgflag1 = 0;
}
그러나 일부 시간은 일반적으로 (첫번째 누르면, UIButton
의 IBOutlets
있습니다 시간) 도청하면 버튼 이미지가 변경되지 않습니다.
나는 여기에서 무슨 일이 일어나고 있는지 전혀 모른다. 사전에 고맙습니다.
감사합니다.