1974 shaares
6 private links
6 private links
The behavior of dispatch_once is in the name. It does something once and only once.
It takes two parameters. The first is a predicate that tracks the "once". The second is a block to execute on the first call.