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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:14:03+00:00 2026-06-08T14:14:03+00:00

I am trying to replace an object at a particular Index in a NSMutableArray

  • 0

I am trying to replace an object at a particular Index in a NSMutableArray however I am getting this error as shown below

2012-07-30 14:50:11.380 PK[3588:907] -[__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance 0x1eded800
2012-07-30 14:50:11.383 PK[3588:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance 0x1eded800'
*** First throw call stack:
(0x357ae56b 0x35a8e97f 0x357b24fb 0x357b0c0d 0x35702e68 0x1082df 0x368528dd 0x3690c869 0x368528dd 0x3685288f 0x3685286d 0x368525c3 0x36852f41 0x36851359 0x3683f2e1 0x3683eb5b 0x385c05f3 0x385c0223 0x3577ec33 0x3577ebd7 0x3577d9d1 0x356fbc1d 0x356fbaa9 0x385bf33b 0x36865535 0x104175 0x344c6b20)
libc++abi.dylib: terminate called throwing an exception

I have declared the the array as an NSMutableArray in the header so it is widely avalible to any method wanting to use it, and below is showing how I use it when trying to set up an NSDictionary object.

//...

// Objects for keys that are for sendSeriesDictionary
    seriesObjects = [NSArray arrayWithObjects: [NSNull null], [NSNull null], [NSNull null], nil];


    if ([manufactureIdString length] != 0) {
        [seriesObjects replaceObjectAtIndex:0 withObject:IdString];
    }
    if ([modelIdString length] != 0) {
        [seriesObjects replaceObjectAtIndex:1 withObject:mIdString];
    }
    if ([subModelIdString length] != 0) {
       [seriesObjects replaceObjectAtIndex:2 withObject:sIdString];
    }

//..

as soon as the thread enters the first if statment is when I get the error listed above.. The reason I have initaly set the NSMutableArray to [NSNull null], is that that if any of the 3 strings are empty that object in the array will not screw things up further down the track when this data is passed across as a call to the server I am communicating with.

Any help would be greatly appreciated… I feel like what I am doing should work, however I also think that maybe the error is being cause by me passing in [NSNull null] in the array objects.. but thats just my observation maybe you guys can tell me more about the situation.

  • 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-08T14:14:04+00:00Added an answer on June 8, 2026 at 2:14 pm

    Create a Mutable array like this

    seriesObjects = [NSMutableArray arrayWithObjects: [NSNull null], [NSNull null], [NSNull null], nil];
    

    and declare seriesObjects as

    NSMutableArray *seriesObjects;
    

    to remove warnings

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

Sidebar

Related Questions

I'm trying to replace an object with a new one and am getting the
I'm trying to replace this: void ProcessRequest(object listenerContext) { var context = (HttpListenerContext)listenerContext; Uri
I am trying to replace an Object inside my nested array (colArray) by using
I have a DOM object with loaded HTML markup. I'm trying to replace all
I have a c# object (below) that I'm trying to send to my javascript.
I'm trying to replace all commas with a comma and a space. This is
im trying to replace normal text with ascii text in this program: so a
Trying to replace any non alpha-numeric characters with a hyphen. Can't see why it
I'm trying to replace the top-level navigation of my site with images instead of
I'm trying to replace the zoom functionality with scroll on my microsoft ergonomic keyboard

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.