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 is uikit framework in ios?
What are different instruments xcode supports for app profiling?
What is the first responder and responder chain?
How to implement "load more" using nsfetchedresultscontroller?
What is iphone sdk?
Do you know any other changes to ios 7 since wwdc?
What is the difference between cocoa and cocoa touch?
What is datasource in ios?
What is meaning of 'atomic' keyword?
What are moments and collections?
What is tableview datasource?
What are all the difference between categories and subclasses in iOS operating system?
Explain difference between nil and nil?
Explain keywords alloc and new?
What is arc in ios?