Name the memory management rules and their related methods.

Answer Posted / maanya

The object you created is owned by you by allocating memory for it, or is owned by you by copying it.
Related Methods: alloc, allocWithZone, copy, copyWithZone, mutableCopy, mutableCopyWithZone.
If you are not the creator of an object but you want it to stay in memory, you can express an ownership interest.
Related Methods: retain.
If you created or expressed ownership interest on an object, and now you are its owner, then you are responsible to release it once you don't need it anymore.
Related Methods: release, autorelease.
If you are not the owner of an object (you did not created it or did not expressed ownership interest) then you must not release it.

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 nsuserdefaults?

476


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

509


What are ios apps written in?

458


Explain the characteristics of ios?

456


What's the latest version of ios?

483






Can you please explain the difference between frame and bounds?

442


Why to keep user policies at server side rather on device? : IOS Architect

1039


What is difference between core data and sqlite in ios?

438


What are design patterns in ios?

482


What are the features of ios?

410


When was ios invented?

488


What are the functions of managed object context?

504


How to parse json?

468


Explain the significance of autorelease?

480


What is the purpose of UIWindow object in iOS operating system?

442