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

Explain your process for tracing and fixing a memory leak

0 Answers  


What is an NSOperationQueue and how/would you use it in iOS operating system?

0 Answers   UGC Corporation,


What is ios realm?

0 Answers  


How do you fix app errors on iphone?

0 Answers  


What does ios mean on my iphone?

0 Answers  






What are the Different types of persistent stores?

0 Answers  


Difference between retain and assign ?

1 Answers  


Multitasking support is available from which version in iOS operating system?

0 Answers   TryTechnicals Pvt Ltd,


What are all the difference between iOS3, iOS4 and iOS5?

0 Answers   UGC Corporation,


What is gcd in ios swift?

0 Answers  


Explain inheritance?

1 Answers  


How much do ios developers get paid?

0 Answers  


Categories