Declaration of 'struct sockaddr_in' will not be visible outside of this function警告的处理

来源:互联网 发布:设计一款人工智能产品 编辑:程序博客网 时间:2024/05/21 19:31


Declaration of 'struct sockaddr_in' will not be visible outside of this function

做ios网络开发的肯定会用到苹果的官方库Reachability。ios5发布了,将项目升级到ios5的过程发一个warning:

+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;

Declaration of 'struct sockaddr_in' will not be visible outside of this function
解决办法很简单,Reachability.h中最前面添加头文件:#import <netinet/in.h>