MKMapView : regionWillChangeAnimated is not called frequently

Discussion in 'iOS Programming' started by namanhams, Sep 7, 2011.

  1. namanhams macrumors regular

    Joined:
    Jun 3, 2009
    #1
    According to Apple documentation :

    This method :
    Code:
    - (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
    is called whenever the currently displayed map region changes. During scrolling, this method may be called many times to report updates to the map position.


    I have tried scrolling, dragging, zooming, but this method is never been called many times. It's called only once at the start.

    What i need is live updating, the same as what the document says.

    Anyone knows why ? Thanks.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The documentation says "may" not "will". The normal behaviour where there are delegates is that will is called before the event and did when the event is complete. I'd implemented

    Code:
    - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
    as well and see if will is called once at the start of the even and did multiple times during the event.
     
  3. namanhams thread starter macrumors regular

    Joined:
    Jun 3, 2009
    #3
    I try both methods and they are called only once.

    I just dont know in what circumstance those methods are called more than once.
     
  4. goodsquirrel macrumors newbie

    Joined:
    May 26, 2012
    #4
    Did you find a solution? I'm facing the same problem...
     

Share This Page