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

  • SEARCH
  • Home
  • 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 7746685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:20:31+00:00 2026-06-01T10:20:31+00:00

Sorry for what should be a simple solution. I am trying to ‘Disable’ a

  • 0

Sorry for what should be a simple solution.

I am trying to ‘Disable’ a button in code using the following Code:

in the first Class which Called ‘CheckBox’:

checkBox.h :

@interface CheckBox : UIViewController 
{   
   BOOL checkboxSelected;
   UIButton *checkBoxButton;
}

 @property (nonatomic, retain) IBOutlet UIButton *checkBoxButton;


- (IBAction)checkBoxButton:(id)sender;


-(void) setCheckBoxSelected:(BOOL)checkingStatus;
-(void) setCheckBoxEnabled:(BOOL)enablingStatus;

in checkBox.m :

- (IBAction)checkBoxButton:(id)sender {

if (checkboxSelected == 0){
    [checkBoxButton setSelected:YES];
    checkboxSelected = 1;

} else {

    [checkBoxButton setSelected:NO];
    checkboxSelected = 0;
      }
}

 -(void) setCheckBoxSelected:(BOOL)checkingStatus {

   checkBoxButton.selected = checkingStatus;
     }

 -(void) setCheckBoxEnabled:(BOOL)enablingStatus {

    [checkBoxButton setEnabled:enablingStatus];
   }

and in the implementation of another class which called ‘MainViewController.m’ :

- (void)viewDidLoad{

     allTransactionCheckBox = [[CheckBox alloc] init];
     [self.viewWithdraw addSubview:withdrawCheckBox.view ]; 
     withdrawCheckBox.labelCheckBox.textColor = [UIColor blackColor];
     withdrawCheckBox.labelCheckBox.font = [UIFont systemFontOfSize:14];
     withdrawCheckBox.labelCheckBox.text = @"Withdraw";   

     [withdrawCheckBox setCheckBoxSelected:YES];
 }

The above code is ‘Disable’ the button, but it (Remove/ Hide) the ‘check mark Picture’ inside the button.Why?

All links ( outlet + Actions ) are connected .

What obvious thing am I missing? Thanks.

  • 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-01T10:20:33+00:00Added an answer on June 1, 2026 at 10:20 am

    You have defined the button in interface builder. It looks like you havent set the image for all control states – select the button and look at the attributes inspector – there is a drop down for normal, highlighted, etc. is your check mark image defined for all those states?

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

Sidebar

Related Questions

This should be simple.... but it's taking a while... Here's the code that's not
I'm sorry to make my first question here a bit of a simple one
First, sorry for the lengthy post. Basically, my question is this: I'm trying to
I know this should be simple but can't figure it out. Here's the code.
Sorry if this is dumb but I was just thinking I should give a
Sorry, I'm sure this is simple but I'm tired and can't figure it out.
I'm trying to write a simple bash script that accepts all arguments and interprets
First of all, sorry about the title -- I couldn't figure out one that
Sorry about the title, not sure how to describe without example. I trying to
Note: Sorry for the amount of pseudo code below, but I didn't know how

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.