Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obj-C objects has two pointers?

What difference between first and second pointer?

like image 715
Evgenii Avatar asked Dec 10 '22 14:12

Evgenii


1 Answers

object is a variable that points to a NSObject instance. That instance is located in memory at the address you mark #2.

But, the variable itself has to exist somewhere and it's located at the address you mark #1.

Or, to look at it another way, you can write NSObject *object;. The content of object is address #2, but the location of object is address #1.

like image 152
Phillip Mills Avatar answered Dec 13 '22 03:12

Phillip Mills