代码之家  ›  专栏  ›  技术社区  ›  Lee Armstrong

mkmapview与exc_bad_访问崩溃

  •  6
  • Lee Armstrong  · 技术社区  · 15 年前

    我有下面一行代码来激活断点

    [mapView addAnnotations:grabinstance.itemArray];
    

    这是随机崩溃。GrabInstance.itemArray总是完全填充的,并且永远不会更改,因为只有在数组已满时才调用该位代码。这个特定的时间在数组中被确认为323个项目。

    nszombieEnabled也找不到任何东西。

    回溯线在下面,第1154行在上面。

    #0  0x0126a372 in _insert ()
    #1  0x0126a312 in _splitNode ()
    #2  0x0126a3b7 in _insert ()
    #3  0x011db253 in -[MKAnnotationContainerView addAnnotation:] ()
    #4  0x011dfc2e in -[MKAnnotationContainerView addAnnotations:] ()
    #5  0x011b0b30 in -[MKMapView addAnnotations:] ()
    #6  0x00009257 in -[BigViewController plotItems] (self=0x614de90, _cmd=0x16464f) at /Users/zzzz/Documents/iPhone Projects/BigProject/Classes/BigViewController.m:1154
    #7  0x005336c1 in _nsnote_callback ()
    #8  0x01c18f99 in __CFXNotificationPost_old ()
    #9  0x01b9833a in _CFXNotificationPostNotification ()
    #10 0x00529266 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
    #11 0x00024071 in -[ItemGrabber parserDidEndDocument:] (self=0x617b540, _cmd=0x689aa3, parser=0xf6b4ab0) at /Users/zzzz/Documents/iPhone Projects/BigProject/Classes/ItemGrabber.m:267
    
    3 回复  |  直到 14 年前
        1
  •  9
  •   Lucien    14 年前

    if (CLLocationCoordinate2DIsValid(place.coordinate)) {
        [_mapView addAnnotation:place];
    } else {
        NSLog(@"place %@ has invalid coordinates", place.name);
    }
    
        2
  •  4
  •   Lee Armstrong    15 年前

        3
  •  1
  •   Mohammed Afsul    14 年前