I've been toying around with Cocoa, Bindings and Core Data, and I have three words to say:

ABSOLUTELY.FUCKING.AMAZING.

Wow. This technology is sorely missing from every other toolkit! It is amazing how much you can accomplish without any code! I'll try to re-implement my failed application in Cocoa, just for the hell of it.

Anyway, I found that in order to save image as data to a Core Data model, and be able to view it in an NSImageView, you have to do a little mucking around:

  1. First, define the attribute in your entity as Binary Data. Obvious.
  2. Drop an NSImageView somewhere on your window. Make sure it is enabled.
  3. In the Bindings options, bind it to data (not value!), and use the NSUnarchiveFromData value transformer.

Done! Value transformers aren't heavily documented, but I got through. The problem was that Apple refers to NSUnarchiveFromDataTransformerName which is a constant that points to NSUnarchiveFromData, while Interface Builder uses the value.

Anyway, small peeve :)

August 15, 2007, 11:23 p.m. More (165 words) 0 comments Feed
Previous entry: New MacBook - First impressions
Next entry: The joy of Eclipse RCP

This post is older than 30 days and comments have been turned off.