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

If you use location services in your app, will it drain your battery.if yes? How can we avoid?

926


What is ipad screen size?

479


What happens if iapplication object does not handle an event?

462


Explain how to silent the noisy keyboard?

459


What is ios architecture?

489






What is singleton in ios swift?

472


What is the first responder and responder chain?

454


What is block in ios swift?

502


What is a model class?

460


How do I open a csv file on my phone?

445


What is ios selector?

426


What is ios viewwillappear?

453


How to measure your application's performance on an iphone device?

431


What is weak and strong in ios?

455


Explain me how to parse xml?

469