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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:17:39+00:00 2026-05-23T17:17:39+00:00

This is a continuation question I had from a post yesterday: Initializing NSMutableDictionary (It’s

  • 0

This is a continuation question I had from a post yesterday: Initializing NSMutableDictionary

(It’s probably a stupid question, but I don’t see what I’m doing wrong.)

I liked the idea of just having “All” listed in my TableView that pops up when the filter button is pressed in order to indicate no filter applied. I get my data from my model class sorted correctly into an NSMutableArray like so:

 NSArray *anArray = [dmgr.CategoryDictionary allKeys];
    self.CategoriesArray = [anArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
    [self.CategoriesArray insertObject:@"All" atIndex:0]; // line causes crash

But I want to add the “All” option to the CategoriesArray to show in the UITableView. When I try to run it, it crashes at that line because of

NSArrayI insertObject:atIndex:]: unrecognized selector sent to instance 0x59baba0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI insertObject:atIndex:]: unrecognized selector sent to instance 0x59baba0'

Any help would be appreciated. Thanks!

  • 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-23T17:17:40+00:00Added an answer on May 23, 2026 at 5:17 pm

    sortedArrayUsingSelector: returns an immutable array which is why you can’t add to it. Do this to get a mutable copy.

    self.CategoriesArray = [NSMutableArray arrayWithArray:[anArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a continuation question from a previous question I have asked I now
This might seem like a stupid question I admit. But I'm in a small
Okay so a continuation from this question , where you experts intro'd me to
This question comes a bit as continuation of the following topic (you don't need
A continuation from this question I need a SQL statement that returns the number
this is a continuation from a previous JQueryUI Autocomplete question, I asked . This
So this is a continuation from my last question - So the question was
Fairly rubbish with PHP, this is a continuation on from my last question .
In a continuation from this question . I'm trying to bind a given function
This question is an continuation on another StackOverflow post where no clear answer is

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.