Singleton objective c clarification

前端 未结 5 910
青春惊慌失措
青春惊慌失措 2020-12-12 02:18

as I continue my studies the book implemented a singleton. I understood the reason why use it but I just wanted some clarification regarding the code.

+ (BN         


        
5条回答
  •  抹茶落季
    2020-12-12 02:51

    That's the initializer of a variable with static storage duration. The value will be set when the executable is loaded into memory.

    Note that its not necessary to explicitly set the value to nil as all variables with static storage duration are automatically set to 0.

提交回复
热议问题