ios - Detect Time Out Error With AFNetworking -
ios - Detect Time Out Error With AFNetworking -
i utilize afnetworking retrieve info web service every thing work perfectly, want observe time out error. used code in failure block of request don't work
failure:^(afhttprequestoperation *operation, nserror *error) { if ([operation.response statuscode] == 408) { //time out error here } }]; the code 408 normaly time out error
since afnetworking build on top on nsulconnection/nsulrsession can nsurlerrortimedout check if error timeout error:
failure:^(afhttprequestoperation *operation, nserror *error) { if (error.code == nsurlerrortimedout) { //time out error here } }]; you checking http status code, since connection timed out there not statuscode.
ios objective-c timeout afnetworking
Comments
Post a Comment