allocWithZone no longer used


From the NSObject API on allocWithZone: - This method exists for historical reasons; memory zones are no longer used by Objective-C.

It’s used in the book to facilitate the creation of singletons. How are singletons best created without using this method, presumably instead with just init? Thanks.


allocWithZone:, while it exists for historical reasons, is still called now. See alloc’s documentation:

For historical reasons, alloc invokes allocWithZone:.