以下是CocoaChina会员 “ijawfx” 分享的XCode里查询本机IP的Objective-C代码,帖子地址http://www.cocoachina.com/bbs/read.php?tid-19634.html
NSHost* myhost =[NSHost currentHost];
NSString *ad = [myhost address];
字符串ad的值就是你的本机ip。
NSHost* myhost =[NSHost currentHost];
NSString *ad = [myhost address];
字符串ad的值就是你的本机ip。
CocoaChina会员ijawfx分享了如何在XCode中使用Objective-C代码查询本机IP的步骤。
494

被折叠的 条评论
为什么被折叠?



