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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:30:26+00:00 2026-06-04T19:30:26+00:00

I run a for to choose which objects to remove. After i removed one

  • 0

I run a for to choose which objects to remove. After i removed one the app crashes.
I´ve read that i couldn´t remove an object in the for because of the index, so i remove them outside but it still crashes. When it crashes at runtime it says the array it is an NSArray which is not, it is a NSMutablearray. Anyone knows why is this happening?

Here is the code:

NSMutableArray *discardedItems = [NSMutableArray array];
NSInteger catalogo = [[tmpDic objectForKey:@"catalogo"] intValue];
NSInteger documento = [[tmpDic objectForKey:@"documento"] intValue];

for (i=0; i<[self.deletedDocuments count] ; i++) 
{
    if ([[[self.deletedDocuments objectAtIndex:i] objectForKey:@"documento"] intValue] == documento &&
        [[[self.deletedDocuments objectAtIndex:i] objectForKey:@"catalogo"] intValue] == catalogo) 
        [discardedItems addObject:[self.deletedDocuments objectAtIndex:i]];
}

NSLog(@"Dictionary\n%@", self.deletedDocuments);
if (discardedItems != nil)
    [self.deletedDocuments removeObjectsInArray:discardedItems];
  • 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-04T19:30:27+00:00Added an answer on June 4, 2026 at 7:30 pm

    are you storing the array in user defaults? objects taken from user defaults will be immutable, even if a mutable subclass was stored

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

Sidebar

Related Questions

Our app lets the user choose a location from a list which is provided
I run the following Gert's extract command to the data dump file which format
Is there a commonly-accepted practice for designing java objects that are frequently loaded and
i have that method that retrieve the removable devices information which are NTFS :
I've run into reoccuring problem for which I haven't found any good examples or
I have two arraylists, one contains Strings and the other contains Classes that have
The Zen of Python states that there should only be one way to do
My C# program allows the user to choose which of several similarly named printers
I have a factory that builds the objects with longest lifetime in my application.
I have an application that continually crashes with at Suspended (exception ActivityNotFoundException). The full

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.