A question related to UIButton
- by vikas Savardekar
I have taken customview in my code for UIButton.
UIButton *button= [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; //(UIButton *)newCell.accessoryView;
[button addTarget:self action:@selector(checkedimage:) forControlEvents:UIControlEventTouchUpInside];
-(IBAction)checkedimage:(id)sender
{
NSLog(@"checkedimage");
if(checkImage == NO)
{
newImage = [UIImage imageNamed:@"a.png"];
checkImage=YES;
}
else if(checkImage==YES)
{
newImage = [UIImage imageNamed:@"b.png"];
checkImage=NO;
}
}
but when i click on UIButton it is not going to action checkedimage
why?