0

I am having issues implementing the code from the answer on this question: iPhone get SSID without private library

I have xcode 4.2 and iOS 5.1.

 #import <SystemConfiguration/CaptiveNetwork.h>

- (id)fetchSSIDInfo
{
    NSArray *ifs = (id)CNCopySupportedInterfaces();
    NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
    id info = nil;
    for (NSString *ifnam in ifs) {
        info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam);
        NSLog(@"%s: %@ => %@", __func__, ifnam, info);
        if (info && [info count]) {
            break;
        }
        [info release];
    }
    [ifs release];
    return [info autorelease];
}

I get the following errors:

enter image description here

What am I doing wrong?

Community
  • 1
  • 1
MrHappyAsthma
  • 6,332
  • 9
  • 48
  • 78

1 Answers1

1

You need to add CFNetwork.framework to your project.

You can do it by selecting Targets > Summary> Linked Framework and Libraries.

Maggie
  • 7,823
  • 7
  • 45
  • 66