Need help in Retain Cycle


#1

In the code [i setContainer:self];
Why are we sending a message to i ?
why we are using self as an argument ? And what is the value of self ?


#2

i is the object that was passed as an argument. So in this particular application, i points to the calculator object. Self is the object that was sent the message, and in this particular application, it points to the backpack object.

One way you can verify this is to print both of these objects to the console in that method:

NSLog(@"%@ %@", i, self);