Runtime error on startup


I created the CarLot project as per your instructions in Chapter 11 and got the following error on startup (sometime after MyDocument’s init: invocation):

2012-09-19 12:51:54.961 CarLot[560:303] Cannot create NSArray from object <MyDocument: 0x10061ae00> of class MyDocument
2012-09-19 12:51:54.978 CarLot[560:303] Cannot create NSArray from object <MyDocument: 0x100141770> of class MyDocument

Fearing a typo or other error on my part, I built and ran the Solution project for CarLot that I downloaded from your website. I got the same error. I’m running XCode 4.4.1 on Mountain Lion. Let me know if I can provide any further information. Thanks.


Never mind! I did a Clean before a Build on the downloaded project and everything worked fine. I’ll root about for my error.


Sounds like your table view’s content binding is not bound to the correct thing, which should be Cars.arrangedObjects.



I had similar runtime errors. While I had the table view context binding set correctly, various other bindings were incorrect. I was able to resolve my problem(s) by comparing the bindings in the downloaded solution with my own.

I’m a noob wrt cocoa, but IMO, it might remove ambiguity if the book’s screen shots indicated the controls in the object hierarchy, rather than on the visual representation of the XIB. For example, when I’m told to "drop a number formatter onto the NSTextField in the price column, which NSTextField is intended? There is one at TableCol->TableCellView->StaticText->TextFieldCell, and another at TableCol->TextFieldCell.