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

  • Home
  • SEARCH
  • 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 8896811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:10:23+00:00 2026-06-15T00:10:23+00:00

some times my app crashed by showing * Collection was mutated while being enumerated

  • 0

some times my app crashed by showing * Collection was mutated while being enumerated . This is occurring in same line of code all the time.please help me on this issue. i stuck on this. the app is crashing at pushing view controller line of my code.but it is not frequent one. my error console

Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘* Collection CALayerArray: 0x1030c730 was mutated while being enumerated.
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”,
“”
)’

my code:

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
 ServiceDetails *service=[[ServiceDetails  alloc] initWithNibName:@"ServiceDetails"   bundle:nil];  
    CompanyListingForm *list=[[CompanyListingForm  alloc]initWithNibName:@"CompanyListingForm" bundle:nil];
[category_company_text resignFirstResponder];
if(viewHoldingTable)
{
    [viewHoldingTable removeFromSuperview];
}
if (category_clicked_flag==0) {
    if (location_or_cat_com==0) {
        NSMutableArray *get=[district_array objectAtIndex:indexPath.row];
        locationid=[[get objectAtIndex:0]intValue];
        [location_textfield resignFirstResponder];
        location_textfield.text=[get objectAtIndex:1];
    }
    else
    {
        if (draggingView) {
            [draggingView removeFromSuperview];

        }
        if (viewHoldingTable) {
            [viewHoldingTable removeFromSuperview];
        }


        NSMutableArray *get=[company_array objectAtIndex:indexPath.row];
        category_company_text.text=[get objectAtIndex:1];



        service.ida=[NSString stringWithFormat:@"%d",[[get objectAtIndex:0] intValue]];

        service.idloc=[NSString stringWithFormat:@"%d",locationid];



        [self.navigationController pushViewController:service animated:YES];//getting error at this point.

        //[emer release];   
    }
}
else
{
    if (location_or_cat_com==0) {
        NSMutableArray *get=[district_array objectAtIndex:indexPath.row];
        locationid=[[get objectAtIndex:0]intValue];
        [location_textfield resignFirstResponder];
        location_textfield.text=[get objectAtIndex:1];
    }
    else
    {
        NSMutableArray *get=[category_array objectAtIndex:indexPath.row];
        category_company_text.text=[get objectAtIndex:1];
        int catid=[[get objectAtIndex:0]intValue];

        list.IDForLoc=[NSString stringWithFormat:@"%d",locationid];
        list.IDForCat=[NSString stringWithFormat:@"%d",catid];
        list.companydetails=[get objectAtIndex:1];
        [self.navigationController pushViewController:list animated:YES];//getting error at this point.

    } 
}
 [service release];
 [list release];
}
  • 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-15T00:10:24+00:00Added an answer on June 15, 2026 at 12:10 am

    I think the problem is that you’re doing all this stuff to the interface at the same time as you’re asking to push a view controller. Try wrapping the pushViewController line in a dispatch_after block, with a delay of, say, .1 seconds, to give the other changes to the interface time to settle down. Or do it the other way: put the removeFromSuperview stuff into a delay. Even better, throw some kind of flag so that the stuff to be removed from the superview is removed later, on viewWillAppear. You don’t need to do it now; you’re about to hide to cover this view with the pushed view controller anyway.

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

Sidebar

Related Questions

My app some times crashes at start-up. In stack-trace only messages from built-in frameworks.
Well I guess this has been asked a thousand times, but for some reason
At random times, my app crashes with this crash log. A magic solution would
We built an app for a client some time back, signed it with our
I've lost some time with a bug in my app due to user authentication.
I've been working with app engine for quite some time, I know that there
I've got a Rails app that's been running live for some time, and I'm
I'm developing an app that starts a System.Threading.Timer which does some fairly rapid reading/writing
I am developing a web app and in this app I sometimes load content
So I was running my app on my iPhone 4 without being connected to

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.