how to get the message in NSLocalizedDescription in iOS?

user2749248 picture user2749248 · Jul 31, 2014 · Viewed 7.4k times · Source

I have this error in requesting data from api.. All I want is to get only the message "The request timed out." in NSLocalizedDescription. How to get that? heres the return error below.

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0xa5bd490 {NSErrorFailingURLStringKey=api url, NSErrorFailingURLKey=api url, NSLocalizedDescription=The request timed out., NSUnderlyingError=0xa5763b0 "The request timed out."}

Answer

user2749248 picture user2749248 · Jul 31, 2014

I solved already this problem issue...

NSString *getError = error.localizedDescription;