shortstuffsushi
shortstuffsushi

Reputation: 2330

Determining Cause of valueForKeyPath exceptions

Recently I changed some Core Data models in a project I was working on. The migration went fine, but I had some wrappers on the objects that did lookups on keypaths (ie: valueForKeyPath:@"@sum.somePropertyThatNoLongerExists"), and the app crashed.

I eventually stumbled across that portion of my code by break pointing step-by-step through to see at what point it crashed, but there was no Strack Trace, no $eax, or any other indicator that I'm aware of that told me where the problem was.

My question is, with valueForKeyPath calls, is there any way to determine when/where you've gone wrong? As far as I know, it does throw an exception (so obviously I could wrap it with try/catch), but most other things that throw are traceable back to their origin, right?

Upvotes: 0

Views: 257

Answers (1)

lawicko
lawicko

Reputation: 7344

I think you can trace the problem by adding all exceptions break point, as described in this blog post.

Upvotes: 2

Related Questions