Subtitle update in annotationView

Is there a way to continue updating the subtitle line in the annotation view? The subtitle line gets the value from another class, which updates the value every second. Is it possible for the subtitles in annotationView to keep updating themselves?

+3
source share
1 answer

Create a method that updates the value of your subtitle and calls this method in the main thread. All changes related to the user interface must be part of the main thread.

[self performSelectorOnMainThread:<#(SEL)#> withObject:<#(id)#> waitUntilDone:<#(BOOL)#>]


-(void)updateValue 
 { 
      if(![NSThread isMainThread]) 
      { 
         [self updateValue]; 
         return; 
      } 
      update your values here. 
 } 
+3
source

All Articles