Life as Clay

Cocoa Programming for Mac OS X: Chapter 11 – Core Data – Depreciated Data Bindings

with 3 comments


Working through the Cocoa book, I successfully built and ran the example Core Data application. All was good until I noticed a build warning, “The ‘data’ binding is depreciated in Mac OS X versions 10.6 and later.” I looked at the discussion forum for the book (which isn’t much of a discussion forum – can’t provide links to other sites) and saw another mention of the problem. The issue comes from using the data binding on the Image Well, as described at the top of page 179 (in the 3rd edition of the book):

Bind the Data (not Value) of the image view to Cars. Choose the controller key selection and the keypath photo.

So, what’s the alternative that doesn’t use depreciated code? I don’t know for certain, but there’s discussion of it at the Mac Rumors forum. It may no longer be possible to create a Core Data application without writing code to implement a Value Transformer, if you want to convert from NSData to NSImage.

I’m sure there are good reasons behind codebase changes like this one. I look forward to understanding enough Obj-C and Cocoa to know what they are.

(Oddly, after doing nothing other than closing and reopening Xcode, I no longer get the build warning, which is even more confusing.)

Advertisements

Written by Clay

December 21, 2009 at 14:27

Posted in Cocoa, Objective-C

Tagged with , , ,

3 Responses

Subscribe to comments with RSS.

  1. […] Depreciated Data Bindings Error one time and then no error the next time he launches.  Click here to read […]

  2. Did you work out how to fix this or just choose to ignore it? As i am doing the same thing at the moment.

    ashleyhughescocoa

    January 18, 2011 at 00:01

    • Hi Ashley, I’m afraid that I never figured this out. I moved on to other projects, including Core Data projects, and I’ve never seen the warning again. You may want to search the Apple cocodev list or post a question there.

      Big Nerd Ranch also put up a better discussion forum for this book in the meantime. You probably can ask there. In fact, have a look at this link: http://forums.bignerdranch.com/viewtopic.php?f=17&t=489

      Clay

      Clay

      January 18, 2011 at 10:04


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: