There are pre-2.0 solutions to be found on the Internet. One of them seems to be as follows:
void *libHandle;
void *airportHandle;
int (*open)(void *);
int (*bind)(void *, NSString *);
int (*close)(void *);
libHandle = dlopen("/System/Library/Frameworks/Preferences.framework/Preferences", RTLD_LAZY);
open = dlsym(libHandle, "Apple80211Open");
bind = dlsym(libHandle, "Apple80211BindToInterface");
close = dlsym(libHandle, "Apple80211Close");
open(&airportHandle);
bind(airportHandle, CFSTR("en0"));
close(&airportHandle);
dlclose(libHandle);
I'm not sure if accessing this framework is off limits. But running it causes a EXC_BAD_ACCESS. So either the code is wrong, the framework has changed or it's somehow locked. Forgive me for any obvious Objective-C faux-pas. I've only been speaking Objective-C since Thursday, so my Objective-C fluency is probably like parachuting a latin speaker into a hostile Transylvanian mountian region.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…