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”’ »
July 28, 2008, 1:45 pm
By default, a Core Data application will refuse to load data created using an older data model. So, if you’ve been using one version of your model for ages and have loads of data, it’s a bit of a pain that should you wish to add an entity, attribute or relationship or make other changes to your model, you won’t be able to open the old data in a new version of your application.
Prior to OS X 10.5 if you wanted to convert data from one model version to another, you had to handle the conversion code entirely yourself. With Leopard, however, Apple built in versioning and migration capabilities to make dealing with data migration a great deal easier.
This article looks at how you can support data migration in your Core Data applications. It shows how to handle changes entirely using Data Model versions and Mapping Models, before looking at customizing the process by using custom migration classes.
Continue reading ‘Core Data Migration and Versioning’ »
Tags:
Apple,
Bindings,
Cocoa,
Code,
Core Data,
Development,
Framework,
Interface Builder,
Xcode Category:
Cocoa,
Core Data,
Programming |
4 Comments
July 26, 2008, 11:44 am
Apple’s Sync Services framework allows applications and devices to keep in sync with each other’s data. If you subscribe to the MobileMe service, for example, it is Sync Services that handles synchronization between the server, your computers and any connected devices such as an iPhone. This article discusses adding synchronization capabilities to Core Data applications. We’ll start by looking at the information you must provide to allow synchronization to take place and then build two sample applications that will keep in sync with each other.
Continue reading ‘Core Data and Sync Services’ »
Tags:
Apple,
Bindings,
Cocoa,
Code,
Core Data,
Development,
Framework,
Interface Builder,
Sync Services,
Xcode Category:
Cocoa,
Core Data,
Programming |
1 Comment
July 9, 2008, 12:56 pm
In this post we’ll walk through one way to use a custom cell to display multiple managed object values in a single table view cell using bindings. The obvious question here is how to bind the Value of the table column in Interface Builder to more than one Model Key Path from Core Data. You can’t, for example, type in a string of attributes like ‘firstName, lastName’ or anything like that to specify that multiple values be taken.
Continue reading ‘Custom Table Cells, Bindings and Core Data’ »