Changes

Objective-C Enumerators

1 byte added, 15:01, 21 October 2009
Enumerators and Variable Names
== Enumerators and Variable Names ==
When using enumerators in Objective-C it is important to be aware that both the enumerator name and the value names are treated as symbols that must be unique within the given scope. For example, because we use the value name ''hot'' in our ''temperature'' enumerator we cannot then use ''hot'' as a variable name within the same scope (for information on variable scope refer to [[Objective-C Variable Scope and Storage Class]]). Take, for the example, the following code. Here we have our temperature enumerator and also a declaration for a variable named ''hot'':
<pre>