Automatic key-value observing is implemented using a technique called isa-swizzling.
The isa pointer, as the name suggests, points to the object’s class which maintains a dispatch table. This dispatch table essentially contains pointers to the methods the class implements, among other data.
When an observer is registered for an attribute of an object the isa pointer of the observed object is modified, pointing to an intermediate class rather than at the true class. As a result the value of the isa pointer does not necessarily reflect the actual class of the instance.
You should never rely on the isa pointer to determine class membership. Instead, you should use the class method to determine the class of an object instance.
Before add observer--------------------------------------------------------------------------
isa:Person, supper class:NSObject
self:<Person: 0x7ffe5aeeb340>, [self superclass]:NSObject
age setter function pointer:0x10fe03c40
name setter function pointer:0x10fe03be0
printInfo function pointer:0x10fe03a30
After add observer--------------------------------------------------------------------------
isa:NSKVONotifying_Person, supper class:Person
self:<Person: 0x7ffe5aeeb340>, [self superclass]:NSObject
age setter function pointer:0x10ff04c7f
name setter function pointer:0x10fe03be0
printInfo function pointer:0x10fe03a30
After remove observer--------------------------------------------------------------------------
isa:Person, supper class:NSObject
self:<Person: 0x7ffe5aeeb340>, [self superclass]:NSObject
age setter function pointer:0x10fe03c40
name setter function pointer:0x10fe03be0
printInfo function pointer:0x10fe03a30