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

cocoa, events, listener, networking, objective-c

Solution

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!).

Problem

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

Original source