AliSoftware / AliSoftware/KeyPathObserver

Inheritence support

Ouverte
#1 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Objective-C
Étoiles
5
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

If you observe a given keyPath in a class A, and observe the very same keyPath in a subclass B of the class A, the block set in class B will override the one in class A.

It won't be possible to call the superclass observer block when you override it in a subclass.

_Note that the standard Apple KVO mechanism has the same issue_

**Possible Fix:** associating to the keyPath not directly the blocks to execute but an NSMutableDictionary that holds the blocks for each class in the object's class hierarchy should solve the problem. When trying to call the block, we will search blocks by going bottom to top in the class hierarchy, thus calling the blocks associated with the current class, then its superclass if any, then its supersuperclass, and so on.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.