bindings
Bidirectional Cocoa Bindings
Sep 24, 2009 20:51 filed in: Programming | Projects
If you have ever tried to bind two “model” objects together then you will have noticed that bindings are one-way. When calling bind on an object you are really indicating that you want that objects property to reflect changes in some other 'observable’ objects property. Not the reverse.
This is fine in most circumstances because we usually bind visuals control to our model. Apple has implemented the two-way logic for us. But what if you wanted to implement this type of ‘magic’ in your own custom views or if you wanted to bind two model objects together? In these cases, you will need to roll out your own bi-directional or two-way bindings. Here I present a simple way to achieve this.
Read More...
This is fine in most circumstances because we usually bind visuals control to our model. Apple has implemented the two-way logic for us. But what if you wanted to implement this type of ‘magic’ in your own custom views or if you wanted to bind two model objects together? In these cases, you will need to roll out your own bi-directional or two-way bindings. Here I present a simple way to achieve this.
Read More...
0 Comments
