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
What are the skills required for ios developer?
What are the different delete rules that a relationship can have?
Explain keywords alloc and new?
What is advantage of categories? What is difference between implementing a category and inheritance?
Which object manage the presentation of app's content on the screen?
Explain the difference between cocoa and cocoa touch?
Does ios support multitasking?
Explain parent-child context setup. How does it work? What are the advantages?
What’s the difference between an “app id” and a “bundle id” and what is each used for?
What is called before viewdidload?
How to measure your application's performance on an iphone device?
What is variable in ios?
What is the use of 'dynamic' keyword?
Difference between coredata & sqlite?
What are the Different types of persistent stores?