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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:30:06+00:00 2026-05-15T11:30:06+00:00

Are there any issues when using IBAction when it is not actually called from

  • 0

Are there any issues when using IBAction when it is not actually called from a user’s action?

If you have an action like

-(IBAction)sayHello:(id)sender;

You can call it from within your class like:

[self sayHello:@"x"]

The @”x” doesn’t do anything, it just fills in for the sender.

You can actually create an IBAction method without (id)sender

-(IBAction)sayHello;

and call it from both user’s actions and from within the code, but then you won’t get any useful sender info from the interface. What’s the ‘correct’ way of filling in for the sender, when calling from the code? And can you create sender info to send when it’s called from within the code?

Just trying to figure it out.

  • 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-15T11:30:07+00:00Added an answer on May 15, 2026 at 11:30 am

    I think a good practice for OOP is to refractor the method
    -(IBAction)sayHello:(id)sender;

    to another method called: -(void)sayHello;
    and inside the method
    -(IBAction)sayHello:(id)sender {
    [self sayHello];
    }

    If other methods want to call the sayHello:(id)sender action to do some job, it can call the sayHello. The method name should make sense for the client to call it without a problem or work around. It will help you when you have to test or debug

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

Sidebar

Related Questions

just a general question are there any issues with using named pipes from a
Are there any relevant security issues in using a file cache (i.e. PEAR Cache_Lite)
Are there any race condition issues when using NSNotifications within a single thread? Here
Are there any issues, with regards to efficiency, for using a function call in
I am wondering if there are any performance overhead issues to consider when using
Is there any way to do it? I often have issues that work locally
Are there any security issues in using JSON for just data transfer, other than
Are there any possible issues with using the default Forms Authentication (see below) on
Are there any issues I may be missing using fastEnumeration with the enumerator below?
Are there any issues to consider when using DRb for implementing an in-memory message

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.