IP Address? - Cocoa

后端 未结 5 565
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 05:27

How would I make a GUI program that displays your Ip address with a click of a button? Please, no difficult explanations, I just started Cocoa not long ago.

Thanks,<

5条回答
  •  感动是毒
    2021-01-01 06:19

    [[NSHost currentHost] addresses] will get you an array of IPs. Read the documentation for NSHost.

    As for displaying that in a GUI, I recommend getting Aaron Hillegass' book Cocoa Programming for Mac OS X, or any Cocoa beginners book should teach that.

提交回复
热议问题