Archive for the ‘Bindings’ Category.
November 27, 2008, 4:54 pm
In this post I’ll walk through writing a custom subclass of NSView that can bind to an NSArrayController to display information either from some generic array connected to the array controller, or from a Core Data object model.
The view we’ll be creating is a custom view to display a pie-chart; in the sample app the pie-chart will be drawn from data entered in an NSTableView. The finished application looks like the following:

Continue reading ‘A Bindable Custom NSView Subclass’ »
Tags:
Apple,
Bindings,
Cocoa,
Code,
Core Data,
Development,
Framework,
Interface Builder,
NSView,
Xcode Category:
Bindings,
Cocoa,
Core Data |
6 Comments
August 27, 2008, 6:38 pm
Chances are, if you’ve developed any kind of Cocoa application, you’ve probably made use of Cocoa Bindings in one way or another, particularly when it comes to Core Data. The technology is ‘key’ to so many of the underlying frameworks but it is a technology that tends to be often-used but frequently not fully understood.
If you are someone who happily binds Array Controllers and View objects together using Interface Builder but have always wondered discretely exactly how the magic behind the scenes happens, or if you just don’t quite comprehend the difference between ‘KVC’ and ‘KVO’ (or perhaps can never quite remember what they stand for…), this article might help you out. In it, I’ll attempt to demonstrate a ‘faux-bindings’ methodology that connects a value from one object with a value from another object, but without using the actual Apple Cocoa Bindings technology. The bare-bones of how the ‘faux binding’ works will be there for all to see; while the internal workings of Cocoa Bindings are a little different, this will hopefully at least show you what, how and why certain things are required for the real Cocoa Bindings to work successfully.
Continue reading ‘On Cocoa Bindings – “Let Us Break Their Bonds Asunder”’ »