Multiple choice

Which of the following is correct about 'assign' attribute in Memory management in Objective C?

  1. It is used to store a direct pointer to the new value, but call release on the old value and retain on the new one.

  2. It uses a direct pointer to the new value.

  3. It increases the retain count of an object by 1.

  4. It decreases the retain count of an object by 1.

  5. It makes a copy of an object and returns it with retain count of 1.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Assign is used to set a property's pointer to the address of the object without retaining it or otherwise curating it.