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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:27:24+00:00 2026-05-25T21:27:24+00:00

I know to send a parameter to a selector, we use withObject , but

  • 0

I know to send a parameter to a selector, we use withObject, but how to handle the following case:

 UIBarButtonItem* backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:[[NavigatorUtil new] autorelease] action:@selector(back:) ];

The back method looks like:

#import "NavigationUtil.h"

@implementation NavigationUtil

+(void) back: (UINavigationController*) navigationController
{
    [navigationController popViewControllerAnimated:YES];
}

@end

Now I need to send a parameter to this selector? How to?

  • 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-25T21:27:25+00:00Added an answer on May 25, 2026 at 9:27 pm

    What do you mean “send a parameter to this selector”? This phrase doesn’t compute.

    It seams to me you should RTFM a little, for example the Event Handling Guide for iOS.

    In short, the button’s “action” is a message that the button sends to its target. In Objective-C, a message is defined by its selector, which can more or less be seen as the method name and signature.

    The button knows about three signatures for this selector: zero, one or two arguments. In your case, you use a method with one argument. You can’t decide what it’s going to be. This argument is always the same. It’s going to be the sender, i.e. the button itself.

    So that’s problem #1 with your action method.

    Problem #2 with your action method is that you defined it as a class method. It should be an instance method.

    Now finally, if you want to reach the UINavigationController from the NavigatonUtil, you need to find another way. For example to store it beforehand as an instance variable.

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

Sidebar

Related Questions

How would I send a Selector to another class? I know to send it
I know how to write the basic c# code to send emails, but I'm
The question: How to use people.get with the me parameter? I know how to
I know how to send mails using the Microsoft Enterprise Library 2.0 using a
I would like to know how to send a post request in curl and
Anyone know if it is easily possible to send **kwargs over PyAMF from NetConnection.call()
I know that default cron's behavior is to send normal and error output to
Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply
I know that it's possible to get SVN to send emails after a commit
Need to know this so that i could send DTMF and that is going

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.