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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:43:21+00:00 2026-05-23T17:43:21+00:00

I have three IBActions, each linked with it’s own button like so: #import Controller.h

  • 0

I have three IBActions, each linked with it’s own button like so:

#import "Controller.h"
#import "Application.h"

@implementation Controller
- (IBAction)deal:(id)sender {
    NSButton *deal = (NSButton *)sender;
    ...
}

- (IBAction)hit:(id)sender {
    NSButton *hit = (NSButton *)sender;
    ...
}

- (IBAction)stay:(id)sender {
    NSButton *stay = (NSButton *)sender;
    ...
}
@end

How do you use/call on a button outside it’s scope? I’m looking to do something like this:

 - (IBAction)hit:(id)sender {
    NSButton *hit = (NSButton *)sender;
    ...
    [hit setEnabled: NO];
    [stay setEnabled: NO]; // Using/altering "Stay's" button
}

Thanks in advance!

  • 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-05-23T17:43:22+00:00Added an answer on May 23, 2026 at 5:43 pm

    IBAction is a typedef of void, used to flag up methods that you want Interface Builder (or Xcode 4’s interface designer to spot. They’re just ordinary methods with no outward link to anything.

    What you probably want is some IBOutlets to connect out to the button. E.g. to connect to the hit button, you’d add this to your @interface:

    IBOutlet NSButton *hit;
    

    Then in Interface Builder or Xcode you should be able to control-drag a link from your class out to the button and connect the outlet — the opposite of what you’ve been doing to connect the button events to your class, effectively.

    Because hit is an instance variable, you can access it from any method in your class.

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

Sidebar

Related Questions

I have three tables: page, attachment, page-attachment I have data like this: page ID
I have a detail view that includes three UIButtons, each of which pushes a
I have a IBAction which is called via a button in my iPad App.
I have written a timer application that passes a speechTime from an IBAction and
I have one base view controller contentViewController with one button the action on button
When I am programming a universal app, lets say I have an IBAction like
I have three view controllers, one root controller, one login view controller and one
I have three tables tag , page , pagetag With the data below page
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through =>
I have three unordered lists that have been created as Scriptaculous Sortables so that

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.