Note that there are some explanatory texts on larger screens.

plurals
  1. PORe-adding annotations on map view to update their title
    primarykey
    data
    text
    <p>As you can see below, I have simulated my problem in a basic way. I have a timer that calls a method periodically. In that method, I have created a switch-case condition to simulate my idea.</p> <p>Once pin is added on the map, then reading (pin keeps dropping) them again. </p> <p>I want to add my pin and then just only change the title that represents a weather value. </p> <pre><code>- (IBAction)playBtn:(id)sender { timer = [NSTimer scheduledTimerWithTimeInterval:(4.0) target:self selector:@selector(control) userInfo:nil repeats:YES]; } -(void)control{ NSMutableArray *annotationArray = [[[NSMutableArray alloc] init] autorelease]; switch (value%2) { case 0: { // Create some annotations Annotation *annotation = nil; annotation = [[Annotation alloc] init]; annotation.coordinate = CLLocationCoordinate2DMake(29.7161,-95.3906); annotation.color = RGB(13, 0, 182); annotation.title = @"17"; [annotationArray addObject:annotation]; [annotation release]; annotation = [[Annotation alloc] init]; annotation.coordinate = CLLocationCoordinate2DMake(30.168456,-95.504480); annotation.color = RGB(0, 182, 146); annotation.title = @"16"; [annotationArray addObject:annotation]; [annotation release]; // Center map //self.mapView.visibleMapRect = [self makeMapRectWithAnnotations:annotationArray]; // Add to map //[self.mapView addAnnotations:annotationArray]; } break; case 1: { // Create some annotations Annotation *annotation = nil; annotation = [[Annotation alloc] init]; annotation.coordinate = CLLocationCoordinate2DMake(29.7161,-95.3906); annotation.color = RGB(13, 0, 182); annotation.title = @"27"; [annotationArray addObject:annotation]; [annotation release]; annotation = [[Annotation alloc] init]; annotation.coordinate = CLLocationCoordinate2DMake(30.168456,-95.504480); annotation.color = RGB(0, 182, 146); annotation.title = @"25"; [annotationArray addObject:annotation]; [annotation release]; } break; } [self.mapView addAnnotations:annotationArray]; [mapView setNeedsDisplay]; value++; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload