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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:12:43+00:00 2026-05-22T01:12:43+00:00

i try to run my app, but i have got an exception thrown, in

  • 0

i try to run my app, but i have got an exception thrown, in the console i have got this :

2011-05-05 00:18:50.984 myApp[2906:207] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x6b8b780> was mutated while being enumerated.(
    "<MyLocation: 0x6b67af0>",
    "<MyLocation: 0x6b19360>",
    "<MyLocation: 0x6b67a70>",
    "<MyLocation: 0x6b8d110>",
    "<MyLocation: 0x6b8d280>",
    "<MyLocation: 0x6b8ce50>",
    "<MyLocation: 0x6b8d660>"
)'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x02915919 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0272a5de objc_exception_throw + 47
    2   CoreFoundation                      0x029153d9 __NSFastEnumerationMutationHandler + 377
    3   myApp                          0x00005755 -[StationsSurLaCarteViewController requestFinished:] + 343
    4   myApp                          0x000195cb -[ASIHTTPRequest reportFinished] + 171
    5   Foundation                          0x000abe9a __NSThreadPerformPerform + 251
    6   CoreFoundation                      0x028f6d7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    7   CoreFoundation                      0x028552cb __CFRunLoopDoSources0 + 571
    8   CoreFoundation                      0x028547c6 __CFRunLoopRun + 470
    9   CoreFoundation                      0x02854280 CFRunLoopRunSpecific + 208
    10  CoreFoundation                      0x028541a1 CFRunLoopRunInMode + 97
    11  GraphicsServices                    0x02e8e2c8 GSEventRunModal + 217
    12  GraphicsServices                    0x02e8e38d GSEventRun + 115
    13  UIKit                               0x0033ab58 UIApplicationMain + 1160
    14  myApp                          0x0000224c main + 102
    15  myApp                          0x000021dd start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
(gdb) 

i noticed that i got that since i try to use the annotations for my map view, help please, thx in advance 🙂

EDIT

this is my for loop which can make problems :

 for (int i=0; i<[array count]; i++) {

           NSDictionary *stationEnCours=[array objectAtIndex:i];


           NSString *distance=[stationEnCours objectForKey:@"distance"];
           float lng = [[stationEnCours objectForKey:@"ssiphone_longitude"]   floatValue];
           float lat = [[stationEnCours objectForKey:@"ssiphone_latitude"] floatValue];
           NSString *ensStation=[stationEnCours objectForKey:@"ssiphone_enseigne"];

           location2D = (CLLocationCoordinate2D){ .latitude = lat, .longitude = lng };
           MyLocation *annotation=[[[MyLocation alloc]initWithName:ensStation distanceVersLaStation:distance coordinate:location2D]autorelease];
           [mapView addAnnotation:annotation];
           MKCoordinateSpan span={latitudeDelta:0.2,longitudeDelta:0.2};
           MKCoordinateRegion region={location2D,span};
           [mapView setRegion:region];
           [self.view addSubview:mapView];
           }`
  • 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-22T01:12:43+00:00Added an answer on May 22, 2026 at 1:12 am

    The given reason for your exception is “Collection … was mutated while being enumerated”. This means you tried to change an array within a for( in ) loop, which is not allowed because it would change the objects that you are supposed to be enumerating. The end of the reason is a dump of the array which you were enumerating. It contains 7 MyLocation objects. If you look at the top of the call stack, you see that the exception occurred in your -[StationsSurLaCarteViewController requestFinished:] method. If you look through that method and find a place where you use fast enumeration, you should easily find your problem.

    If you want to modify an array while using fast enumeration, there are two possibilities: keep track of all of the things you want to change (i.e. a list of indexes to remove) and make the changes after the loop, or do the enumeration over a copy of the array. Here is an example of the second method:

    NSArray *copiedArray = [originalArray copy];
    for(id theObject in copiedArray) {
        if([theObject shouldBeDeleted]) {
            [originalArray removeObject:theObject];
        }
    }
    [copiedArray release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to build a metro-style-app with Javascript and when I run the Windows
I'm getting this error when I try run DB:Rake : ** Invoke db:migrate (first_time)
So I've got this exception defined, protected constructors, static constructor methods (so all the
I've tried to run a Wicket app in an embedded Jetty, using this code:
I have got a multi-threaded app that process a very large data file. Works
I have created an app, that fetchs data from mysql using php. But when
I have a Django app and I'm getting an error whenever I try to
This spec passes just fine on my CentOS development box, but fails when run
I have samsung i5503 galaxy. I got a problem in developing app. First I
I try run jconsole with jar that contains my classes like: cd C:\Program Files\Java\jdk1.6.0_26\bin

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.