allocWithZone no longer used


#1

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.


#2

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

For historical reasons, alloc invokes allocWithZone:.