We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c925fff commit 7574278Copy full SHA for 7574278
01《招聘一个靠谱的iOS》面试题参考答案/《招聘一个靠谱的iOS》面试题参考答案(下).md
@@ -745,6 +745,8 @@ observer中需要实现一下方法:
745
```
746
这是完全没有必要的代码,不要这么做,这样的话,KVO代码会被调用两次。KVO在调用存取方法之前总是调用 `willChangeValueForKey:` ,之后总是调用 `didChangeValueForkey:` 。怎么做到的呢?答案是通过 isa 混写(isa-swizzling)。下文《apple用什么方式实现对一个对象的KVO?》会有详述。
747
748
+参考链接: [µ](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/KeyValueObserving/Articles/KVOCompliance.html#//apple_ref/doc/uid/20002178-SW3)
749
+
750
751
###47. 若一个类有实例变量 `NSString *_foo` ,调用setValue:forKey:时,可以以foo还是 `_foo` 作为key?
752
都可以。
0 commit comments