报错:
workspaceios/xxx/xxx/Utils/Utils.m:468:27: Declaration of 'select' must be imported from module 'Darwin.POSIX.sys.time' before it is required
调用语句:
struct timeval tm = {3, 0};
fd_set wset,rset;
FD_ZERO(&wset);
FD_ZERO(&rset);
FD_SET(socketFileDescriptor,&wset);
FD_SET(socketFileDescriptor,&rset);
long t1 = time(NULL);
int res = select(socketFileDescriptor+1,&rset,&wset,NULL,&tm);
解决方法:
添加头文件:
#import <sys/time.h>