What's the correct method to subclass a singleton class in Objective -C?

后端 未结 9 957
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 18:23

I have created a singleton class and I want to create a class which is subclass of this singleton class, what is the correct method to do it

9条回答
  •  情书的邮戳
    2020-12-09 18:45

    I had a similar problem and the way I solved it is to create a singleton wrapper class which has all the extra functionality. This singleton class contains the original singleton (has the singleton instance as a member variable). This way you can avoid dirty tricks.

提交回复
热议问题