Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the previous task, you saw how to set up a method in an object. But objects can contain both methods and data. In this task, you’ll see how to store data in objects. You’ll also see how to pass arguments to object methods.
You set up your data in variables in the @interface section. Then your code can access those variables by name in the methods in the @implementation section. For example, the code here stores an integer: