Name the memory management rules and their related methods.



Name the memory management rules and their related methods...

Answer / 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

More Apple iOS Interview Questions

What is a protocol in objective-c programming language?

0 Answers  


What is ios deadlock?

0 Answers  


Why don’t we use strong for enum property in objective-c ?

0 Answers  


What is singleton class in ios?

0 Answers  


What is ios design?

0 Answers  






Outline the class hierarchy for a UIButton until NSObject.

1 Answers  


Which is the default for synthesized properties?

0 Answers  


What are the memory management rules?

1 Answers  


How to delete images in ios?

0 Answers  


Why do we override drawrect: method? How to explicitly call it?

0 Answers  


Explain place holder constraint

0 Answers  


Explain iglistkit?

0 Answers  


Categories