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 8817089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:46:00+00:00 2026-06-14T04:46:00+00:00

I am new to Objective C and Xcode so please be patient with me!!

  • 0

I am new to Objective C and Xcode so please be patient with me!! I have written a program that controls 5 buttons and 1 reset button. If any of the 5 buttons are pressed, they should all be disabled (greyed out) until the reset button is pressed. Here is my attempt:

ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController{
    IBOutlet UIButton *button1;
    IBOutlet UIButton *button2;
    IBOutlet UIButton *button3;
    IBOutlet UIButton *button4;
    IBOutlet UIButton *button5;
    IBOutlet UIButton *resetButton;
}
    @property(retain,nonatomic)UIButton *button1;
    @property(retain,nonatomic)UIButton *button2;
    @property(retain,nonatomic)UIButton *button3;
    @property(retain,nonatomic)UIButton *button4;
    @property(retain,nonatomic)UIButton *button5;
    @property(retain,nonatomic)UIButton *resetButton;
    - (IBAction)anyButtonPressed:(UIButton *)sender;
    - (IBAction)resetPressed:(UIButton *)sender;

@end

ViewController.m

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize button1, button2, button3, button4, button5, resetButton;

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

-(IBAction)anyButtonPressed{
    button1.enabled = NO;
    button2.enabled = NO;
    button3.enabled = NO;
    button4.enabled = NO;
    button5.enabled = NO;

}

-(IBAction)resetPressed{
    button1.enabled = YES;
    button2.enabled = YES;
    button3.enabled = YES;
    button4.enabled = YES;
    button5.enabled = YES;

}

@end

But it says incomplete implementation next to ViewController and when I press a button in the simulator, it crashes. Help me please? Also please suggest any easier ways to implement this!

  • 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-14T04:46:02+00:00Added an answer on June 14, 2026 at 4:46 am

    Your button action method signatures are not correct in your implementation. Change your code to:

    -(IBAction)anyButtonPressed:(UIButton *)sender {
        button1.enabled = NO;
        button2.enabled = NO;
        button3.enabled = NO;
        button4.enabled = NO;
        button5.enabled = NO;
    }
    
    -(IBAction)resetPressed:(UIButton *)sender {
        button1.enabled = YES;
        button2.enabled = YES;
        button3.enabled = YES;
        button4.enabled = YES;
        button5.enabled = YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to developing with xCode and Objective C, and I have a simple
Im new to xcode and objective c. I have asked this question three times
I am very new to xcode & Objective-C (having come from PHP) i have
I am new to objective-c, xcode and app dev so please bear this in
I am new to Xcode and objective C programming.Please help me to resolve the
I'm new to Objective-C and XCode, but I was happy to see that XCode
I am new to objective-C and Xcode and I am trying to pass an
I'm new to xcode and objective-c. I also decided to add unit (logic) tests
Hey there, I'm a designer thats really new to programming with xcode or Objective-C
I am fairly new to XCode and the Objective-C language. When I am instantiating

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.