1.

State the difference between strong, weak, read only and copy.

Answer»

The DIFFERENCE between strong, weak, read-only and copy is as FOLLOWS

  • Strong: This property MAINTAINS a reference to property throughout the lifetime of an object. When you declare strong, you intend to "own" the object you are referencing. Data you assign to this property will not be destroyed as long as you or any other object references it strongly.
  • Weak: It means that the object should be kept in memory as long as someone points to it strongly, and you don't need control over its lifetime.
  • Read-only: An object's property can be defined initially, but it cannot be altered or modified.
  • Copy: This attribute is an alternative to strong. In place of taking ownership of a CURRENT object, it creates a copy of whatever you assign to the property, then takes ownership of that copy.


Discussion

No Comment Found