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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:17:27+00:00 2026-05-28T16:17:27+00:00

In .Net when I have an object that has an event I can register

  • 0

In .Net when I have an object that has an event I can register to handle that event via a delegate:

void Test()
{
    Button button = new Button();
    button.Click  += new EventHandler(OnClick);
}
void OnClick(object sender, EventArgs e)
{
    text1.Text = "The Button Was Clicked";
}

How do I do this sort of thing in Objective-C? Specifically I’m trying to handle the ccTouchEnded of a SneakyButton. I thought it would be something like this:

SneakyButton* mybutton = [SneakyButton button];
[mybutton ccTouchEnded:self.onButtonDown];

- (void)onButtonDown:(UITouch *)touch withEvent:(UIEvent *)event
{
    CCLOG(@"The Button Was Clicked");
}
  • 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-28T16:17:28+00:00Added an answer on May 28, 2026 at 4:17 pm

    Cocoa and CocoaTouch often uses “Target/Action”.

    • Target: an objc object. the target is what gets messaged.
    • Action: a selector. the action is the selector to message the target with.

    In that sense, the action is the equivalent.

    When the target/action is performed, it would take this general form:

    [target performSelector:action withObject:someParameter];
    

    of course, the parameter list will vary in the real world.

    The UIControl class is quite small – read it for more info on the subject. It will give you a good idea of a control’s target/action support and the interfaces you’ll use for handling these events. NSControl is the Cocoa counterpart, but that’s a much larger class – it defines much more than Target/Action interfaces.

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

Sidebar

Related Questions

I have a plugin that creates an object that has an event. Is there
I know that ASP.NET controls such as the button have the postback event model.
Situation : C#, .NET 3.5, WinForms Objective : Form1 has a Button that can
We have a .NET object that does a lot of reading/writing with the database.
An interesting question arose today. Let's say I have a .NET object that implements
I have a Javascript object that basically represents a Row in an .NET GridView.
I have a COM object that I'm trying to use from C++ (not .NET),
If I have .Net Form with a component/object such as a textbox that I
I know that the asp.net repeater doesnt have a Client side object model, and
I have an ASP.NET WebService that returns an object of List public class Students

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.