Changes

Jump to: navigation, search

Pointers and Indirection in Objective-C

31 bytes added, 14:42, 27 May 2010
Indirection and Objects
BankAccount *account1 = [[BankAccount alloc] init];
</pre>
<google>ADSDAQBOX_FLOW</google>
The first line of code (BankAccount *account1;) is actually declaring that the variable named ''account1'' is a ''pointer to an object of type BankAccount''. We are, therefore, using indirection to provide a handle to our object. The calls to the alloc and init methods subsequently create the object in memory and the assign the address of that object to the account1 pointer variable. We are, therefore, using indirection once again.

Navigation menu