Wednesday 15 July 2015

objective c - How to load multiple annotation titles without freezing the application in iOS -



objective c - How to load multiple annotation titles without freezing the application in iOS -

hi working in first application. plz find below code , help me out in this.

when loading map loading annotations in map when drag map near more annotations app freezing time based on annotation count if there around 100 annotations no problem times getting more 2000 4000 annotations, @ time app freezing more time, because observed when drag map near annotations titles loading(reading). how can resolve these conflict. there way can prepare issue loading titles in ground or other way app should not freeze.

if having reference update me .

- (mkannotationview *)mapview:(mkmapview *)mv viewforannotation:(id <mkannotation>)annotation { static nsstring *reuseid = @"reuseid"; mkannotationview *av = [_map_view dequeuereusableannotationviewwithidentifier:reuseid]; if (av == nil) { av = [[mkannotationview alloc] initwithannotation:annotation reuseidentifier:reuseid] ; } else { av.annotation = annotation; } nslog(@"title %@",annotation.title); nsstring *title = stringorempty(annotation.title); if ([title isequaltostring:@"current location"] ) { av.image = [uiimage imagenamed:@"user_icon21.png"]; av.centeroffset = cgpointmake(0.0f, -17.5f); } else if ([title isequaltostring:@""]) { av.image = nil; } else { av.image = [uiimage imagenamed:@"rmap1.png"]; av.centeroffset = cgpointmake(0.0f, -15.0f); } av.canshowcallout = yes; homecoming av;

thanks in advance,helping hands appreciated.

ios objective-c mkmapview mkannotation mkmapviewdelegate

No comments:

Post a Comment