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

How many types of background modes supported in ios?

539


What is a memory leak ios?

551


What is meaning of 'copy' keyword?

618


Explain the characteristics of ios?

585


How are non-atomic and atomic properties different? Which one is the default property for synthesized properties?

564






What is appdelegate in xcode?

558


How can we prevent ios 8 app’s streaming video media from being captured by quicktime player on yosemite during screen recording?

563


What json framework supported by ios?

631


How to represent layer objects in iOS operating system ?

593


What is message forwarding?

562


What are ibeacons in ios? : IOS Architect

643


Explain arc?

653


What is synchronous vs. Asynchronous in gcd ?

581


Is xcode a framework?

624


What is background mode in ios?

603