2012-05-03 73 views
8

時使用Reachability.h —蘋果的代碼來處理在iOS連接:警告使用Reachability.h

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

我收到以下警告:

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

回答

21

添加#import <netinet/in.h>在Reachability.h文件並且此警告將消失..:D

+0

這沒有奏效。該警告消失了我的應用程序的精簡版,但不是標準版本的目標。 – TheLearner

+1

清理並再次構建您的目標.. –

+0

也適用於ios7 – Knightsy