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 are most ios apps written in?

0 Answers  


When would you say that an app is not in a running state?

0 Answers  


What is Task?

1 Answers  


Who is the founder of ios?

0 Answers  


What is dynamic dispatch ios?

0 Answers  


Explain the different types of ios application states.

0 Answers  


what is the difference between nonatomic & atomic ? which is thread safe and why

0 Answers  


Which is the state an app reaches briefly on its way to being suspended?

0 Answers  


what is the difference between Xcode, Cocoa and Objective C?

0 Answers  


Can you please explain the difference between frame and bounds?

0 Answers  


Difference between retain and assign ?

1 Answers  


. Apart from incorporating views and controls, what else an app can incorporate?

1 Answers  


Categories