Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![ivan hernandez](https://uploads.teamtreehouse.com/production/profile-photos/785732/micro_1507544_10152271879643054_1308513299_n.jpg)
ivan hernandez
Courses Plus Student 2,298 PointsIOS7 Get SSID and BSSid
I´m having problems getting SSID, I´m using this code but I don't get anything ...
-(void)getCurrentWifi{
(NSString *)GetCurrentWifiHotSpotName{
NSString *wifiname = nil;
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
NSLog(@"informacion: %@", info);
if (info[@"SSID"]) {
wifiname = info[@"SSID"];
}
}
Ben Jakuben , Amit Bijlani , any tips??? what is wrong with this code???
thx
4 Answers
![Stefan Jansen](https://secure.gravatar.com/avatar/ad22fe95cdfc30810a99abc8647330f6?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Stefan Jansen
8,974 PointsI use this code, it works like a charm. :)
- (NSString *)getCurrentWiFiName
{
NSString *ssid = @"NO WIFI!";
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
if ([ifs count] > 0) {
for (NSString *ifname in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifname);
if (info[@"SSID"]) {
ssid = info[@"SSID"];
}
}
}
return ssid;
}
![ivan hernandez](https://uploads.teamtreehouse.com/production/profile-photos/785732/micro_1507544_10152271879643054_1308513299_n.jpg)
ivan hernandez
Courses Plus Student 2,298 PointsHi there, I used that code but I get IFS=null ... But I guess the problems is with the simulardor I need to try it in phone to see what happens
![Amit Bijlani](https://uploads.teamtreehouse.com/production/profile-photos/5393/micro_NewProfile2.jpg)
Amit Bijlani
Treehouse Guest TeacherI've never had to do this so I'll point you to this answer on Stack Overflow: http://stackoverflow.com/questions/5198716/iphone-get-ssid-without-private-library
![ivan hernandez](https://uploads.teamtreehouse.com/production/profile-photos/785732/micro_1507544_10152271879643054_1308513299_n.jpg)
ivan hernandez
Courses Plus Student 2,298 PointsAmit,
Thank you for you answer.