A question related to UIButton

Posted by vikas Savardekar on Stack Overflow See other posts from Stack Overflow or by vikas Savardekar
Published on 2010-04-24T13:12:35Z Indexed on 2010/04/24 13:53 UTC
Read the original article Hit count: 221

Filed under:

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?

© Stack Overflow or respective owner

Related posts about iphone