Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法不断更新annotationView中的字幕字符串?字幕字符串从另一个每秒更新值的类中获取它的值。是否可以在 annotationView 中获取字幕以不断更新自己?
创建一个更新字幕值的方法并在主线程中调用此方法。所有与 UI 相关的更改都应在主线程中进行。
[self performSelectorOnMainThread:<#(SEL)#> withObject:<#(id)#> waitUntilDone:<#(BOOL)#>] -(void)updateValue { if(![NSThread isMainThread]) { [self updateValue]; return; } update your values here. }