Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

2.8. static

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.

Example 2.13. Global Static Variables

int scramingZombieHitCount = 1;          // accessible from all modules

static int screamingZombieBounceCount;    // accessible only from this module

					  


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial