iphone - Dragging annotation view causes multiple triggering of drag state delegate method -


this 1 bit obscure.

this mkmapviewdelegate has method supposed tell when sart , finish dragging annotation view. have implemented so:

- (void)mapview:(mkmapview *)mapview annotationview:(mkannotationview *)annotationview didchangedragstate:(mkannotationviewdragstate)newstate fromoldstate:(mkannotationviewdragstate)oldstate {      if (oldstate == mkannotationviewdragstatestarting && newstate == mkannotationviewdragstateending)     {         nslog(@"ending drag");     }      if (newstate == mkannotationviewdragstatestarting)     {         nslog(@"beginning drag");     } } 

this kind of works. however, when stop dragging annotation, , drag again, above method triggered twice, 3 times etc. console displays:

beginning drag ending drag  beginning drag beginning drag ending drag ending drag  beginning drag beginning drag beginning drag ending drag ending drag ending drag  beginning drag beginning drag beginning drag beginning drag ending drag ending drag ending drag ending drag 

any ideas on causing this?

i seemed solve adding:

[annotationview setdragstate:mkannotationviewdragstatenone]; 

in 'ending drag' part of if statement.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -