KVO

KVO使用觀察者模式,監聽指定的屬性的變化。通常用於model層和controller層之間,view層通過controller層來監聽model的變化。 如果有兩個類BankObject, PersonObject. PersonObject的實例希望監聽BankObject類的accountBalance屬性 先通過addObserver:forKeyPath:options:context:
相關文章
相關標籤/搜索