开发者

Getting notified when the network connection changes in a Cocoa / Obj-C application

Is there any way to be notif开发者_StackOverflowied / have your Cocoa application listen for changes in the network connection (disconnect, connect, etc.)? How does something like HardwareGrowler do it?


After looking at the source code for HardwareGrowler (found under /Extras in the source code for Growl, I figure that the easiest way would be to use the NetworkNotifier.m class and change all calls to AppDelegate functions to whatever callbacks you want executed when the network connection changes (and give them credit for their code!).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜