Error Domain=NSPOSIXErrorDomain Code=9 "The operation couldn’t be completed. Bad file descriptor"
在https://devforums.apple.com/message/278770#278770有一个类似的问题的答案:
It means that someone has been deallocating file descriptors out from underneath NSURLConnection.
但是在我自己的代码中,我不会以任何方式触摸文件描述符的任何流.这只是简单的GET / POST请求.
可能是这个问题的原因?
有人在他们的AFNetworking操作中遇到这个错误吗?
解决方法
Note: When your app resumes execution the actual error returned by a
socket’s whose resources have been reclaimed is purposely not
specified here to allow for future refinements. However,in many cases
the error will beEBADF
,which is probably not what you were
expecting! Under normal circumstancesEBADF
means that the app has passed an invalid file descriptor to a system call. However,in the case of a socket whose resources have been reclaimed,it does not mean that the file descriptor was invalid,just that the socket is no longer usable.