What is saving iOS in the backend

Consider that I select an object. Please see the image below.

enter image description here

In the above image, * myObject is a pointer. This refers to the space allocated to this object. When we save an object, I like to know what it does on the backend. I also like to know why we do this.

Also, when we release it, how it works on the backend.

I also like to know what happens in the backend when copying an object.

I am very sorry if my question is so simple.

0
ios objective-c copy retaincount
Oct 20
source share
1 answer

What actually saves under the hood is this:

  • Take global lock at objc runtime
  • Look at a hash table entry based on a pointer to a stored object
  • Counter increment in this entry
  • Release the lock

I do not expect this to be all that is useful in practice, but I think this is what you asked for.

+3
Oct 20 '12 at 16:27
source share



All Articles