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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:34:56+00:00 2026-05-19T22:34:56+00:00

everywhere they say what IBAction is but do not explain what the whole declaration

  • 0

everywhere they say what IBAction is but do not explain what the whole declaration means.

What is sender and id?

Regards,
Namratha

  • 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-19T22:34:57+00:00Added an answer on May 19, 2026 at 10:34 pm
    1. According to my knowledge IBAction just implies void

    2. id is a generic C type, which accepts objects of any kind/class. It is some what similar to void pointer in C. We can use id as a parameter of a method, in case, if objects of difference kind of classes will access that method.

    3. sender, here,

      • is a human-named parameter name (you can name it anything)
      • it refers the object which calls the method changeGreeting:

    An Example:

    Lets assume the method changeGreeting: is defined in ClassA, and it reads like the following.

    - (IBAction)changeGreeting:(id)sender {
    
        [sender setText:@"Hello %@", [sender class]];
    
        // Nothing can be returned from this method
    }
    

    And consider we have the following lines in Class B.

    // LINE 1
    [aLabel addTarget:objOfClassA action:@selector(changeGreeting:) forControlEvents:UIControlEventTouchUpInside];
    
    // LINE 2
    [aTextField addTarget:objOfClassA action:@selector(changeGreeting:) forControlEvents:UIControlEventTouchUpInside];
    

    In LINE 1, aLabel is the sender and objOfClassA is the receiver. And in LINE 2: aTextField is the sender and objOfClassA is the receiver. HereaLabel & aTextField are called senders because they are calling the method changeGreeting:. And objOfClassA is called receiver because objOfClassA's changeGreeting: method is called here.

    When the user touches inside the aLabel or aTextField, their text will be changed to Hello UILabel or Hello UITextField respectively.

    The other Way:
    We can also call changeGreeting: method of objOfClassA from Class B like the following.

    [objOfClassA changeGreeting:aLabel];
    [objOfClassA changeGreeting:aTextField];
    

    As the above code is self explanatory, objOfClassA is the receiver. But aLabel & aTextField are not the senders. Because they are not invoking the method. Here they are just the arguments. Here the actual sender is Class B, but aLabel and aTextField are passed in the argument (id)sender. Either way the result of the method execution is same.

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

Sidebar

Related Questions

Everywhere I read about the new DLR in .net 4, they say that a
Everywhere I look always the same explanation pop ups. Configure the view resolver. <bean
I have been searching everywhere for the following functionality in Lisp, and have gotten
This is a question you can read everywhere on the web with various answers:
Emacs puts backup files named foo~ everywhere and I don't like having to remember
I would like to access a class everywhere in my application, how can I
Just about every piece of example code everywhere omits error handling (because it confuses
So like most new .NET developers you start of passing DataSets everywhere and although
Here's something I haven't been able to fix, and I've looked everywhere . Perhaps
I'm trying to parse a date/time string using DateTime.ParseExact . It works everywhere, except

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.