Le 21 sept. 2015 à 20:46, Eric Wasylishen <[email protected]> a écrit : > > Hi David, > Yes, COObject and any subclass should be automatically KVC/KVO compliant. > Quentin: any special exceptions I'm forgetting?
For properties marked as @dynamic, synthesized accessors are always in the form of -will/DidChangeValueForProperty:. For optimized accessors, you have to write your own accessors based on patterns described in 'Writing Accessors' section of COObject class description. If you follow these accessors patterns, then behind the scene COObject will end up calling the right KVO methods such as -will/DidChange:valuesAtIndexes:forKey:. Another thing to be aware is that +[COObject automaticallyNotifiesObserversForKey:] returns NO for all properties declared in the metamodel. This means automatic KVO based on class swizzling doesn't work for transient properties declared in the metamodel. This is a bug/limitation. I plan to fix it at some point. > COAttributedStringWrapper.m (in CoreObject/Extras/Model) is an example of an > NSTextStorage implementation that uses KVO to observe some model objects. > This is used in the Typewriter sample app, so if you undo changes/revert to > an old revision, the UI updates automatically. Typewriter and > COAttributedStringWrapper.m are only tested on OS X, however. > > Eric > > > On Mon, Sep 21, 2015 at 3:37 AM, David Chisnall <[email protected]> wrote: > Hi, > > While EtoileUI is still evolving, is it possible to use CoreObject with > bindings? Do COObject / COGroup and friends conform to KVC / KVO? > > David > > -- Sent from my Difference Engine > > _______________________________________________ > Etoile-dev mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-dev > _______________________________________________ Etoile-dev mailing list [email protected] https://mail.gna.org/listinfo/etoile-dev
