Difference between retain and assign ?



Difference between retain and assign ?..

Answer / babu

Assign and retain was used in manual memory management (MRC) environment.

assign to set a property’s pointer to the address of the object without retaining it. use weak to have the property point to nil automatically if the object assigned to it is deallocated .

Use retain by default and will manage the object’s reference count automatically whether another object is assigned to the property or it’s set to nil; In ARC you will use strong instead of retain.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

What is delegation pattern in ios?

0 Answers  


Is ios development hard?

0 Answers  


What is closures in ios?

0 Answers  


Explain the usage of struct?

0 Answers  


What persistent storage core data uses to save data?

0 Answers  






Explain how app delegate is declared by Xcode project templates?

0 Answers  


What are ibeacons in ios? : IOS Architect

0 Answers  


What is mvc in ios swift?

0 Answers  


What is @dynamic and any place where it is used?

0 Answers  


How to pass parameter to selector function in swift? : IOS Architect

0 Answers  


What is nsoperation and nsoperationqueue?

0 Answers  


What is message forwarding?

0 Answers  


Categories