Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:33:52+00:00 2026-06-02T14:33:52+00:00

I am trying to make a menu using checkboxes, which i have created programmatically.

  • 0

I am trying to make a menu using checkboxes, which i have created programmatically.
Heres how i made my checkBox:

UIButton* checkBox = [[UIButton alloc] initWithFrame:CGRectMake(60,60,300, 44)]; 
[checkBox setImage:[UIImage imageNamed:@"unmarked.png"] forState:UIControlStateNormal];
[checkBox addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[checkBox setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
[self.view addSubview:checkBox];

And the Target :

- (void)toggleButton: (id) sender
{
    checkboxSelected = !checkboxSelected;
    UIButton* check = (UIButton*) sender;
    if (checkboxSelected == NO)
        [check setImage:[UIImage imageNamed:@"unmarked.png"] forState:UIControlStateNormal];
    else
        [check setImage:[UIImage imageNamed:@"marked.png"] forState:UIControlStateNormal];

}

Now I am making a simple custom UIButton, I want to check if the checkbox is checked or not using this custom UIButton and NSLog the same i.e If the checkBox is checked then on button click it should NSLog that the checkBox is checked..!

Can anyone help me with this..?

Any help will be truly appreciated.

Thanks for your time

Shailesh

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:33:53+00:00Added an answer on June 2, 2026 at 2:33 pm

    You should consider to use UISwitch, because checkboxes are not that nice on apple mobile devices. You can refer to a tutorial, e.g. here:
    http://www.xprogress.com/post-30-uiswitch-tutorial-example-how-to-use-the-switch-in-xcode-for-iphone-sample-included/

    or here for doing it programatically:
    Creating a UISwitch Programmatically

    Nevertheless, if you insist to use checkboxes look here:
    How to create a simple checkbox in iOS?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a drop down menu using javascript/jquery but can't get my
I have been trying to make the sub-menu horizontal. In my HTML it looks
I am trying to make a simple menu with a nice transition effect using
In the application that I am trying to make, I have a menu in
I'm trying to make a menu using tags, and you can see it here,
I'm trying to make Jeditable works on new elements created using this jquery file
I'm trying to make an horizontal menu, vertically and horizontally aligned. I'm actually using
I'm trying to make a drop-down menu using two divs, the first <div> has
Generally I have MenuItems model and trying to make '/menu_items(/:id(:/some_action))' URLs looks like '/menu(/:id(:/some_action))'
I'm trying to make a simple accordion style menu using divs: <div class=subdomainLevel> Subdomain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.