34,333
edits
Changes
→Indirection and Object Copying
== Indirection and Object Copying ==
The fact that our references to object objects utilize indirection it is important to understand that when we use the assignment operator (=) to assign one object to another we are not actually creating a copy of the object. Instead, we are creating a second pointer to the same object:
<pre>
</pre>
In the above example, we will end up with two pointers (account1 and account2) that point to the same location in memory. We have not, therefore, created a copy of account1. For details on copying objects refer to the chapter entitled [[Copying Objects in Objective-C]].