Changes

An Overview of Objective-C Object Oriented Programming

5 bytes added, 19:40, 14 October 2009
Calling Methods and Accessing Instance Data
== Calling Methods and Accessing Instance Data ==
Given the length of this chapter, now is probably a good time to recap what we have done so far. We have now created a new class called BankAccount. Within this new class we declared some instance variables to contain the bank account number and current balance together with some instance methods used to set , get and display these values. In the preceding section we covered the steps necessary to create and initialize an instance of our new class. The next step is to learn how to call the instance methods we built into our class.
The syntax for invoking methods is to place the instance variable name and method to be called in square brackets ([]). For example, to call the ''displayAccountInfo'' method on the instance of the class we created previously we would use the following syntax: