Tech and a few other things RSS 2.0
# Monday, September 28, 2009
Error Readout:
1st Error:
this class is not key value coding-compliant for the key managedObjectContext

2nd Error:
NSImageCell's object value must be an NSImage

Fix:
1st Error:
There is one prominent reason you could get this answer. You didn't spell your property correctly when you were binding it to....well....whatever you want to bind it to, in my case it was an Array Controller.

My problem however had nothing to do with this. When I created a new project after I upgraded to xCode 3.2 I forgot to check one very import checkbox, Create document-based application (Note: it was not a check box in older version of xCode it was a full icon selection upon creating a project). By not checking this I created a big variety of problems for myself. One of the errors occurring when I didn't check the Create document-based application, was the error this class is not key value coding-compliant for the key managedObjectContext.

2nd Error:
This error is very clear in it's issue. I was creating an entity with a property of native type binary and the compiler wanted NSImage. Grrr but I should be able to pass an image as a binary object, I would say to myself as I had urges to break my laptop and anything else in reach over my knee. My fix again was to simply create a project and remember to click Create document-based application. I know this is not your typical fix, but in case someone else runs into this issue the same way I did I hope they find this and it will be a quick and easy resolution.

Explanation:
All of this pain could have been resolved from the very beginning had I known to click Create document-based application. It was a silly little mistake that cost me a few hours. In my defense however I was under the impression of not checking Create document-based because in Hillegass's book he states that for this exercise we will not be using NSDocument, but NSPersistentDocument instead. It turns out this still means you have to check Create document-based application.

I will state that I should have known something was wrong when I didn't have a MyDocument.xib in the Resource folder after I created the project.

I've attached an image, mainly because blog posts are more fun when there is an image, but also because it shows where this one simple little check box changed my life for a hot minute.



Monday, September 28, 2009 10:55:19 AM (Central Standard Time, UTC-06:00)  #    Comments [5] - Trackback
Mac OS X | Objective C | Snow Leopard
Tuesday, September 29, 2009 3:31:00 AM (Central Standard Time, UTC-06:00)
Yada. Yada. Yada. I can't wait to try out your iPhone app. I'm sure it will be awesome. You'll just have to buy me an iPhone first. Oh, and a data plan too. Sounds like a fair trade.
The Talking Walnut
Tuesday, September 29, 2009 10:42:15 AM (Central Standard Time, UTC-06:00)
Whoa, somebody legitimately commented on my blog...kinda.

I'm so happy.
Ben
Wednesday, October 28, 2009 2:56:13 PM (Central Standard Time, UTC-06:00)
I don't get it.
Thursday, July 22, 2010 2:02:35 PM (Central Standard Time, UTC-06:00)
What if I dont/cant use a document based project? I am getting this same error...
Dean K
Sunday, August 22, 2010 8:46:38 AM (Central Standard Time, UTC-06:00)
Dean,
Which error are you getting, the first one or the second one.
Ben
Comments are closed.
Navigation
About the author/Disclaimer
        

My name is Ben Coffman. I like to build things: programs, programming teams, programming departments and maybe one day a company with lots of programmers. When I turn the internet off I focus on my family, random hobbies, and sharing moments in life.

Blogs I follow:

1. 2andahalfd.com

2. Jeff Lamarche

3. Scott Hanselman

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Ben Coffman

Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
All Content © 2012,

Sign In