Difference between retain and assign ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the extension of ios files?

490


What is background mode in ios?

467


What is array in ios?

433


Explain differences between foundation and corefoundation

484


From which ios version, arc is supported?

427






What is mapping model?

438


What is iphone architecture?

492


Compare and contrast the different ways of achieving concurrency in os x and ios.

533


Explain difference between sax parser and dom parser?

415


What is the difference between developer and enterprise developer accounts?

409


Flow of push notification?

497


What is push notification?

522


What are all the difference between categories and subclasses in iOS operating system?

435


What is grand central dispatch ios?

485


Who is the developer of ios?

456