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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:21:48+00:00 2026-05-17T02:21:48+00:00

i have been working on a small demo and i wrote a function which

  • 0

i have been working on a small demo and i wrote a function which accepts two string object and looks like this

-(void)adding:(NSString*)num1 :(NSString*)num2
{
    num1 = first.text; //first is object of label
    num2 = second.text; //second is object of label

    int x= [num1 integerValue];
    int y = [num2 integerValue];

    int r = x+y;
    NSLog(@"%d",r);
}

am having one more function

-(void)calling
{
    [self performSelector:@selector(adding:)withObject:@"num1" withObject:@"num2"];
}

and am calling the method named calling on button touch up inside event

[btn addTarget:self action:@selector(calling) forControlEvents:UIControlEventTouchUpInside];

but i get an error called unrecognized selector sent to instance

can you please tell me where i am wrong and how to pass methods with arguments to selector.
Thank you

  • 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-17T02:21:49+00:00Added an answer on May 17, 2026 at 2:21 am

    You’re missing a colon. Try this :

    [self performSelector:@selector(adding::)withObject:@"num1" withObject:@"num2"];
    

    However, it’s bad form to have unnamed parameters on your method names because errors like this happen 😉

    I’d rename your method to be

    -(void)adding:(NSString*)num1 to:(NSString*)num
    

    and have this line :

    [self performSelector:@selector(adding:to:)withObject:@"num1" withObject:@"num2"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a small Plagiarism detection engine which uses Idea from
I have been working for two weeks on JamVM, a small but powerful Java
I have this small project I have been working on. I have a MySQL
I have been working on this, very, small photo cms lately. And now i
I have been working with a small project recently which involves Struts 2 and
I have been working now for few days on a small C program which
I have a small application which is much like a clock. It has been
I have been working on a small php app (400K total). But in the
Have been working on this question for a couple hours and have come close
I have been working on this app for at least 3-4 months and just

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.