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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:15:55+00:00 2026-06-11T17:15:55+00:00

Hello I have a tricky trouble with performSelector on NSMutableArray. It is possible I

  • 0

Hello I have a tricky trouble with performSelector on NSMutableArray. It is possible I misunderstood what performSelector does.
Basically i have NSMutableArray with objects (all of them are objects based on my class which inherits from UIButton, but that is not important i guess) and i need send message to all objects in array.

In header file of my class i have declared function, which is called by selector. It looks like this:

-(void)scaleChangedWithANumber:(NSNumber *)scale;

In this example my array contains 3 objects. If i call them item by item, it works perfect:

NSNumber *tmpNumber=[NSNumber numberWithFloat:scale];


ButtonOfElement *tmpButton1=[elementsButtonContainer objectAtIndex:0];
[tmpButton1 performSelector:@selector(scaleChangedWithANumber:) withObject:tmpNumber];

ButtonOfElement *tmpButton2=[elementsButtonContainer objectAtIndex:1];
[tmpButton2 performSelector:@selector(scaleChangedWithANumber:) withObject:tmpNumber];

ButtonOfElement *tmpButton3=[elementsButtonContainer objectAtIndex:2];
[tmpButton3 performSelector:@selector(scaleChangedWithANumber:) withObject:tmpNumber];

But if I try to call performSelector on array (i need to send message to all of objects in array):

NSNumber *tmpNumber=[NSNumber numberWithFloat:scale];
[elementsButtonContainer performSelector:@selector(scaleChangedWithANumber:) withObject:tmpNumber];
tmpNumber=nil;

I get error:

[__NSArrayM scaleChangedWithANumber:]: unrecognized selector sent to instance 0x1737f0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM scaleChangedWithANumber:]: unrecognized selector sent to instance 0x1737f0'
*** First throw call stack:
(0x34e456c3 0x370be97f 0x34e49227 0x34e47951 0x34d9f468 0x31d1 0x369a70eb 0x369a7447 0x369324d9 0x368f9c0d 0x36ae5649 0x3681df4f 0x3681c9b3 0x3682791f 0x368274eb 0x36814f29 0x36814843 0x337425d3 0x33742203 0x34e1a593 0x34e1a537 0x34e193b9 0x34d8c39d 0x34d8c229 0x3374131b 0x368688f9 0x2363 0x2308)
libc++abi.dylib: terminate called throwing an exception

I can use loop and call perform selector item by item of course, but i thought it will be more elegant and clearer to use performSelector on array.

  • 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-06-11T17:15:56+00:00Added an answer on June 11, 2026 at 5:15 pm

    Try this:

    [elementsButtonContainer makeObjectsPerformSelector:@selector(scaleChangedWithANumber:) withObject:tmpNumber];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have like this 2 tables class User public int UserId{get;set;} { ....
Hello i have 2 arrays and and i want to put them in a
Hello I have this code class Triplets { public: int nVal1; int nVal2; NodeT
Let's say I have this HTML: <textarea>blah</textarea> <br> <div class=select_this>hello!</div> How can I select
I have a templated class holding a value. Is it possible to add a
Hello I have next function, what always return null as result, but service calling
hello i have this question i was trying to find a way to call
hello I have my code that connects to my ftp server $conn_id = ftp_connect($ftp_server);
Hello I have a UISegmentedControl with two segments. The selected segment is modified programmatically
Hello I have a datatable that I would like to filter with a single

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.