{"id":362,"date":"2007-06-21T10:41:53","date_gmt":"2007-06-21T17:41:53","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/362\/observing-collections-with-bindings"},"modified":"2007-06-21T10:44:21","modified_gmt":"2007-06-21T17:44:21","slug":"observing-collections-with-bindings","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/362\/observing-collections-with-bindings","title":{"rendered":"Observing Collections With Bindings"},"content":{"rendered":"<p>I just noticed a new section on mmalc&#8217;s very helpful &#8220;Cocoa Bindings Examples and Hints&#8221;:<\/p>\n<p>\n<a href=\"http:\/\/homepage.mac.com\/mmalc\/CocoaExamples\/controllers.html#observingACollection\">Observing a Collection<\/a>\n<\/p>\n<p>\nI have personally found this very confusing when I&#8217;ve  used bindings in my projects. The problem arises when you&#8217;ve got application model data stored in some &#8220;free&#8221; data structure like a dictionary or array. The model data can be manipulated quite handily with standard UI and array controllers, but what about cluing the rest of your application into the change? I find the problem of &#8220;bottom-up&#8221; observing with deeply nested data models to be one of the hardest problems with bindings, both conceptually and practically.\n<\/p>\n<p>\nTo me, mmalc&#8217;s explanation just confirms what I thought was true: bindings kind of sucks for nested &#8220;pure&#8221; models. There often must be some custom code associated with your model, or else you&#8217;ll have to jump through hoops to observe the changes in the data from some higher altitude.\n<\/p>\n<p>\nI&#8217;m not sure what Apple should do to make it better, but I hope they do it. Or is my desire to store everything in dictionaries and arrays just a flaw in my thinking? Maybe I&#8217;m asking for too much.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just noticed a new section on mmalc&#8217;s very helpful &#8220;Cocoa Bindings Examples and Hints&#8221;: Observing a Collection I have personally found this very confusing when I&#8217;ve used bindings in my projects. The problem arises when you&#8217;ve got application model data stored in some &#8220;free&#8221; data structure like a dictionary or array. The model data [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-cocoa","category-programming"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":0,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}