On Jul 17, 2013, at 1:49 PM, Jim Brandt wrote: Is there a downside to using global variables?
Yes. It's been several years since I looked into the use of global variables, but it does have one drawback.
Global variables are persistent.
In other words, when you launch an application, the values from the previous launch are remembered.
This means that the application (bundle) is self modifying.
Which, in turn, means that use of global variables will interfere with, for example, codesigning and perhaps other security measures used in Lion or Mt Lion.
For this reason, I never use global variables and never modify a property.
If any of this has changed recently perhaps someone can update us.
|