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 |
Explain the difference between copy and retain?
How to parse json?
Why do we override drawrect: method?
What is dependency injection in ios?
what is Xcode?
Which language is best for ios development?
Explain commonly used third party libraries
What are b-trees?
Name and explain the iOS app states.
How to use reusable cell in uitableview?
What are the different store migration options? When are they used? How do they work? What is mapping model?
What is the first responder?