Program keeps crashing


#1

Something very strange is going on. After going through chapter 23 and implementing the asset types in a new tableview my program would continue crashing.
I went through the code I changed and saw nothing. After copying out some code from the Solutions program that you can download from BNR it would still continue crashing. Running their program everything worked fine of course.

So finally I decided to just copy paste the entire solution they made for me and go on from there. To my surprise, it would continue crashing though. I completely erased what I made myself, replaced it with what BNR made. Only thing different, to my knowledge, is the folder the files are in and it would continue to crash. I even deleted the app from my iOS simulator and tried to start from scratch.

The moment the app crashes right now is when I try to add a new BNRItem. It returns with this error message:

2014-03-27 10:23:41.182 HomePwner[16354:60b] Adding after 0 items, order = 1.00 2014-03-27 10:23:41.220 HomePwner[16354:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<BNRDetailViewController 0x8d44ad0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key showAssetTypePicker.'

I’m at a loss and quite bewildered on this. I hope someone can help me.


#2

Right. I managed to stop the crashing, but not really by doing anything sensible.
I simply changed the deployment version from 7.0 to 7.1 and re-ran it and it stopped crashing.

So I’m thinking, since I had an exact copy of the same project somewhere else which did run perfectly, is it at all possible a bad setting was cached for the folder I was running this project from?


#3

[quote=“Arthurzwit”]Something very strange is going on. After going through chapter 23 and implementing the asset types in a new tableview my program would continue crashing.
I went through the code I changed and saw nothing. After copying out some code from the Solutions program that you can download from BNR it would still continue crashing. Running their program everything worked fine of course.

So finally I decided to just copy paste the entire solution they made for me and go on from there. To my surprise, it would continue crashing though. I completely erased what I made myself, replaced it with what BNR made. Only thing different, to my knowledge, is the folder the files are in and it would continue to crash. I even deleted the app from my iOS simulator and tried to start from scratch.

The moment the app crashes right now is when I try to add a new BNRItem. It returns with this error message:

2014-03-27 10:23:41.182 HomePwner[16354:60b] Adding after 0 items, order = 1.00 2014-03-27 10:23:41.220 HomePwner[16354:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<BNRDetailViewController 0x8d44ad0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key showAssetTypePicker.'

I’m at a loss and quite bewildered on this. I hope someone can help me.[/quote]

Pretty much any time you see a “this class is not key value coding-compliant for the key foobar” crash, it means it is a problem with your XIB file. When I see this, the first thing I do is open the XIB file that the error mentions (BNRDetailViewController here), and right click on the File’s Owner. You’ll probably see a warning sign next to the property that the error mentions (showAssetTypePicker). Usually this means you renamed something manually in the source file.

If everything looks good in the XIB file, then it usually means that there is a cached NIB file in the simulator / device that still has the old data. Since running on 7.1 fixes your problem, I suspect this is the case. Deleting the app from the simulator / device will then resolve this issue.