Skip to content

Commit c40252e

Browse files
committed
修改46题的参考链接【46. 如何手动触发一个value的KVO】
1 parent 7183ff7 commit c40252e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

01《招聘一个靠谱的iOS》面试题参考答案/《招聘一个靠谱的iOS》面试题参考答案(下).md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ observer中需要实现一下方法:
804804
```
805805
这是完全没有必要的代码,不要这么做,这样的话,KVO代码会被调用两次。KVO在调用存取方法之前总是调用 `willChangeValueForKey:` ,之后总是调用 `didChangeValueForkey:` 。怎么做到的呢?答案是通过 isa 混写(isa-swizzling)。下文《apple用什么方式实现对一个对象的KVO?》会有详述。
806806

807-
参考链接: [µ](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/KeyValueObserving/Articles/KVOCompliance.html#//apple_ref/doc/uid/20002178-SW3)
807+
参考链接: [Manual Change Notification---Apple 官方文档](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/KeyValueObserving/Articles/KVOCompliance.html#//apple_ref/doc/uid/20002178-SW3)
808808

809809

810810
###47. 若一个类有实例变量 `NSString *_foo` ,调用setValue:forKey:时,可以以foo还是 `_foo` 作为key?

0 commit comments

Comments
 (0)