This is a mistake in your code, not a bug in Apple's. NSUnderlyingErrorKey
is documented to have an NSError
object as the value corresponding to it. Your code should instead do something like:
NSError *underlying = [NSError errorWithDomain:NSPOSIXErrorDomain code:1 userInfo:nil];