NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@"Please, other format selected.", NSLocalizedDescriptionKey, @"This format is not available.", NSLocalizedFailureReasonErrorKey, @"The operation couldn't be completed.", NSUnderlyingErrorKey, self.URL, NSURLErrorKey, nil];
NSLog(@"dict:%@", dict); // no Crash
NSError *error = [NSError errorWithDomain:@"testError" code:1 userInfo:dict];// crash
why crashing when allocate error object?
Here are the crash details:
+[__NSCFConstantString objectForKey:]: unrecognized selector sent to class 0x3ebf5550
IIRC
NSUnderlyingErrorKeyis supposed to be another instance ofNSError.From the docs: