Hour 8. Declaring Instance Variables in an Interface File

What You’ll Learn in This Hour

Creating an instance variable for a class instance

Using id

Working with static typing

Using variable scoping

Declaring Instance Variables and Properties

There are two ways of declaring the data elements that are part of a class. You can declare them as instance variables in the same way that you declare integers and floats. You can also declare them as properties of the class. This hour explores the use of instance variables. In the next hour, Hour 9, “Declaring Properties in an Interface File,” you find out how to use properties to accomplish the same results. With declared properties, the compiler actually generates the declarations you see in ...

Get Sams Teach Yourself Objective-C in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.