Implementing CheckBox in iOS App Xcode | iOS Programmer Guide

As the iOS doesn't have a checkbox control, let us implement with the help of UIButton control as per the below code snippet added in viewDidLoad event.

UIButton *checkbox and
BOOL checkBoxSelected;
checkbox = [[UIButton alloc] initWithFrame:CGRectMake(x,y,20,20)
// 20x20 is the size of the checckbox that you want
// create 2 images sizes 20x20 , one empty square and
// another of the same square with the checkmark in it
// Create 2 UIImages with these new images, then:

[checkbox setBackgroundImage:[UIImage imageNamed:@"notselectedcheckbox.png"]
                    forState:UIControlStateNormal];
[checkbox setBackgroundImage:[UIImage imageNamed:@"selectedcheckbox.png"]
                    forState:UIControlStateSelected];
[checkbox setBackgroundImage:[UIImage imageNamed:@"selectedcheckbox.png"]
                    forState:UIControlStateHighlighted];
checkbox.adjustsImageWhenHighlighted=YES;
[checkbox addTarget.....]
[self.view addSubview:checkbox];
Now in the button click or touch up inside event 'checkboxSelected' add the following:
-(void)checkboxSelected:(id)sender
{
    checkboxSelected = !checkboxSelected;
    [checkbox setSelected:checkboxSelected];
}