我想从中获得一些有用的信息NSError
。如果我打印出来[error userInfo]
,我会得到以下信息:
{
NSFilePath = "/Users/apple/Library/Application Support/iPhone Simulator/5.1/Applications/08260B6A-4D65-48DF-ADD1-FFC8750081E8/Documents/abc";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=17 \"The operation couldn\U2019t be completed. File exists\"";
}
我想显示最后一行:“文件存在”,但我怎样才能把它挑出来?
我试过了:
localizedDescription
localizedFailureReason
localizedRecoverySuggestion
localizedRecoveryOptions
recoveryAttempter
他们都不显示“文件存在”。