NSDictionary objectForKey: Crash.

https://www.icloud.com/iclouddrive/0LhunzDSrXWF6qO5fmuyor0yQ#image_(6)



    NSDictionary *description = @{@"a": (self.a ? : @"(null)"),
                                  @"b": [self stringWithState:self.state],
                                  @"c": (self.c ? : @"(null)"),
                                  @"d": (self.product ? self.product.description : @"(null)"),
                                  @"e": (self.e ? : @"(null)"),
                                  @"f": ((self.f && self.f.length > 10) ? [self.f substringToIndex:10] : @"(null)"),
                                  @"g": (self.g ? : @"(null)"),
                                  @"h": (self.h ? : @{}),
                                  @"i": (self.i ? : @"(null)"),
                                  @"j": ((self.j && self.j.length > 20) ? [self.j substringToIndex:20] : @"(null)"),
                                  @"k": (self.k ? : @{}),
                                  @"l": (self.l ? : @"(null)"),
                                  @"m": (self.m ? : @{}),
                                  @"n": (self.n ? : @{})
                                  };
    return [description description];


I use it in the code form above.

By the way, there have been reports of a crash occurring in certain situations.

I can't figure out the cause, so I ask for help.

What should I check?

Replies

Your screen shot shows that you’re using a third-party crash reporter which is obscuring critical details about the crash. I recommend that you remove that. See my Implementing Your Own Crash Reporter post for more advice on that front.

Regardless, crashes like this are almost always the result of some memory management problem. A good place to start is using the standard Memory debugging tools to try to reproduce the problem in your office.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"