How do I convert (or create) a singleton class that compiles and behaves correctly when using automatic reference counting (ARC) in Xcode 4.2?
Ios – How to implement an Objective-C singleton that is compatible with ARC
automatic-ref-countingiosobjective csingleton
Related Topic
- Ios – What kind of leaks does automatic reference counting in Objective-C not prevent or minimize
- Objective-c – How to disable ARC for a single file in a project
- Python – Creating a singleton in Python
- Ios – Should IBOutlets be strong or weak under ARC
- Objective-c – Why is @autoreleasepool still needed with ARC
- Ios – Why does Apple recommend to use dispatch_once for implementing the singleton pattern under ARC
- Swift – Using a dispatch_once singleton model in Swift
Best Answer
In exactly the same way that you (should) have been doing it already: