문제

I got an Exception

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x1fd68a20 {NSErrorFailingURLStringKey=http://mac-mini.local/~user/restcon/auth?username=&password=, NSErrorFailingURLKey=http://mac-mini.local/~user/restcon/auth?username=&password=, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x1fd25730 "The request timed out."}

How can I get the NSLocalizedDescription?

If I 'po 0x1fd68a20' in debugger, I can get the NSDictionary I want. But the [exception userInfo] returns me nil.

도움이 되었습니까?

해결책

Assuming your exception is in an object of type NSException, try

NSString *errorDescription = [exception.error.userInfo valueForKey:NSLocalizedDescriptionKey].
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top