Changes

Jump to: navigation, search

Pointers and Indirection in Objective-C

No change in size, 18:06, 1 February 2016
m
Text replacement - "<google>ADSDAQBOX_FLOW</google>" to "<htmlet>adsdaqbox_flow</htmlet>"
BankAccount *account1 = [[BankAccount alloc] init];
</pre>
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
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