Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The static keyword in C has some additional meanings and is not used the way it is in Java. Java uses static to declare a single persistent class variable within a class declaration. Objective-C does not allow you to declare variables in a class definition. Instead, static variables are declared as global C variables or static variables inside a code block. Listing 2-13 declares two static variables.
|
Code View:
Scroll
/
Show All int scramingZombieHitCount = 1; // accessible from all modules static int screamingZombieBounceCount; // accessible only from this module |