@synchronized does not appear when using automatic completion because Apple does not display this keyword for code implementation. At the suggestion of Apple, I published a bug report.
However, I can offer an autocomplete solution. You can create an @synchronized snippet that can be automatically completed or dragged into your code.
- Copy / paste the code below into one of your Xcode documents.
- Select the new code and drag it into the fragment library.
- Double-click the new fragment and click "Edit."
- Type @synchronized for the completion shortcut.
For more information: http://nshipster.com/xcode-snippets/
@synchronized(anObj) {
// Everything between the braces is protected by the @synchronized directive.
}
source
share