Categoria NSTimer(GCKAdditions)
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Uma categoria no NSTimer que adiciona algumas melhorias úteis.
+ (NSTimer *) gck_scheduledTimerWithTimeInterval: |
|
(NSTimeInterval) |
interval |
weakTarget: |
|
(id) |
target |
selector: |
|
(SEL) |
selector |
userInfo: |
|
(nullable id) |
userInfo |
repeats: |
|
(BOOL) |
repeats |
|
|
| |
Constrói um NSTimer com um destino fraco.
Evita um loop de retenção entre o timer e o objetivo. O timer será invalidado automaticamente se o destino for liberado quando ele for acionado.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2023-12-02 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2023-12-02 UTC."],[[["This category provides useful enhancements to the standard `NSTimer` class."],["It introduces a method to create timers with weak targets, preventing retain cycles."],["Timers created with this category automatically invalidate if the target is released."]]],["The document describes an NSTimer category enhancement called `gck_scheduledTimerWithTimeInterval`. This class method constructs an NSTimer with a weak target, preventing retain loops. It takes parameters for the time interval, target, selector, user info, and whether the timer repeats. If the target is released when the timer fires, the timer automatically invalidates itself. It adds the ability to use NSTimers without the risk of creating retain cycles.\n"]]