0

I have a class which implements ˚ protocol and has the property netAbsAmount. I decided to remove it but now I am getting the following error:

[<Person 0xa37b6b0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key netAbsAmount.

I think I understand what is wrong but I don't know how to fix it. I am changing my model but it has to work with previous data. So, the old data would have property netAbsAmount but the new model does not. In the initWithCoder method, the netAbsAmount property is not set anyways so I don't see what the problem is. In other words, that is a property that is not used previously and so is not encoded in encodeWithCoder during serialization and not initialized at initWithCoder during deserialization.

Setting breakpoints and walking through, the crash occurs after viewWillAppear but before cellForRowAtIndexPath:

How do I fix this?

Thanks.

oky_sabeni
  • 7,672
  • 15
  • 65
  • 89
  • Do you have a nib file that has a connection to that outlet? – progrmr Apr 20 '13 at 15:32
  • No. The Person class has no nib and is a model class. – oky_sabeni Apr 20 '13 at 15:34
  • 1
    Set an exception breakpoint. Trigger the exception. Copy the full stack trace and paste it into your question. – rob mayoff Apr 20 '13 at 16:18
  • @robmayoff The problem is that I don't know where to set the breakpoint. I set it at viewWillAppear and cellForRowAtIndexPath. That is the root view controller called IouViewController. It passes viewWillAppear fine but then it crashes before cellForRowAtIndexPath. My question is what is after viewWillAppear but before cellForRow. The IouViewController is a regular UIViewController with a UITableView to display the data. Thanks. – oky_sabeni Apr 20 '13 at 23:36
  • 1
    [How to add an exception breakpoint](http://developer.apple.com/library/mac/#recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html) – rob mayoff Apr 21 '13 at 01:18
  • @robmayoff While using exception breakpoint, I figure out where the mistake is. I was using a sortDescriptor that was using that property and it crashes the app. Thank you. – oky_sabeni Apr 22 '13 at 04:19

0 Answers0