Apple Singleton example query?

前端 未结 2 1988
北恋
北恋 2021-01-24 06:46

I am a little confused by this snippet of code (presented in the CocoaFundamentals guide) that overrides some of the methods when creating a singleton instance.

         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 07:16

    There is a good example of different singleton methods with comments here on SO: What does your Objective-C singleton look like?

    If it helps, the example has a different approach to allocWithZone: which returns nil.

提交回复
热议问题