ios - How to make a variable in Objective C a single assignment variable -


I use an ISO project in a global string variable (declaring it in the main and reusing it in different classes) I am here. It is to ensure that once I assign a value for it, it can not be fixed again. How to do this

You can use GCD for this:

  Fixed Float value = 0f; + (Zero) Set Value: (Float) _Value {Static Dispatch_Con_t_Once Talk; Transmission_and (& amp; once token, ^ {value = _value;}); }  

This assignment can be done once.


Comments