AFAIK, it is not possible to programmatically connect to a wireless network (without using private API's, cudnt find those in my installed SDK).
FYI, Apple has been removing applications from AppStore that act as wireless sniffers. In any case, the API's are private and in violation of Apple's Dev Agreement. I've tried doing it to no avail, in case you do find any resource on it, do let me know. Currently im going the IP way & using reachability to go about doing some stuff on wireless... nt sure how far it'll go.