_thereIsNoSadnessLikeTheDeathOfOptimism

Hi,


I have seen a crash stacktrace when the exception seems to be thrown from _thereIsNoSadnessLikeTheDeathOfOptimism


Is there an explanation on whats causing this exception?


Cheers,

Rendy

Replies

It boils down to the fact that there was an unexpected runtime exception. Typically, that's caused by things like putting values in a Transformable attribute that aren't NSCoding compatible.


The runtime is sort of split on how it deals with runtime problems:

  • Something like NSManagedObject's save method expects that there could be validation errors, so if there are it'll package those up (putting them into an NSDetailedErrors object if necessary) and pass that back.
  • Most other runtime errors are going to be treated as unexpected exceptions and thrown.

And the places in the code where those exceptions are caught and forwarded in an organized manner occasionally get infamous names like thereIsNoSadnessLikeTheDeathOfOptimism. I think the idea is to make them easier to find.