Text disappearing when adding a new car


I have a peculiar problem with the CarLot example, and since there’s no code to write for it I’m at a bit of a loss as to what to debug.

When I start the program everything looks fine:

But when I hit the “Add” button the text for the Make/Model column will disappear for all the rows except the one that was selected before hitting “Add”:

Selecting one of the rows with the missing text will cause it to be refreshed:

As far as I can tell I have the bindings all done up correctly. Anybody know what the problem might be?


I just encountered a similar issue, except that the “Model/Make” text disappears when the “special” checkbox is checked or unchecked. Once the row is selected again, the text comes back. And it only happens to entries with an image. If I don’t add an image to the car, the “bold” function works as expected. Does anyone know why this is happening?


I’d suggest checking the debug output (where NSLog statements appear); an exception is probably being thrown. It can be tricky to parse the exception output to find the problem, so feel free to post the output here if you’re unable to trace it to its cause.



Thanks for replying! I looked at the output and this is what I’ve got (besides making the purchaseDate the current date, I also assigned 3 to the condition property by default):

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “x86_64-apple-darwin”.tty /dev/ttys000
[Switching to process 16638 thread 0x0]
2012-04-29 23:00:56.817 CarLot[16638:707] starting edit of <NSManagedObject: 0x100546b10> (entity: Car; id: 0x100564fd0 x-coredata:///Car/tE8E13F6E-1307-4646-99E1-4B8B08DC62E92 ; data: {
condition = 3;
datePurchased = “2012-04-30 06:00:56 +0000”;
makeModel = nil;
onSpecial = nil;
photo = nil;
price = 0;
}) in row 0
2012-04-29 23:00:58.843 CarLot[16638:707] starting edit of <NSManagedObject: 0x100574350> (entity: Car; id: 0x100537400 x-coredata:///Car/tE8E13F6E-1307-4646-99E1-4B8B08DC62E93 ; data: {
condition = 3;
datePurchased = “2012-04-30 06:00:58 +0000”;
makeModel = nil;
onSpecial = nil;
photo = nil;
price = 0;
}) in row 1

I did’t see any exceptions being thrown though…


Same here, no exceptions.

I also have the issue choconoir has, where the text disappears when the “special” checkbox is toggled. And, as with him, the only rows that are affected (both for the problem I described and the problem he described) are rows that have images.


I discovered the source of the problem, though I don’t quite understand it. In comparing the XIB in my project with the one in the solution I found that mine had gotten a bunch of layout constraints in it, whereas the solution does not.

To fix it I went to the File Inspector for MyDocument.xib and unchecked “Use Auto Layout” (the solution’s MyDocument.xib has this unchecked as well). Text no longer disappears. Problem solved.

It seems that “Use Auto Layout” is checked by default when creating a new empty XIB, at least in Xcode 4.3.2.


So does anyone know why this happens? I tried playing with autolayout but nothing helps short of disabling it.


I can confirm what Bjorne and CGAllred have reported. When “Auto Layout” is enabled the text of Make/Model cell becomes invisible if and only if an image is provided in this row. Interestingly the price column is not affected.

I’m using XCode 4.6.2 on OS X 10.8.3.