如何在iPhone sdk中以编程方式获取设备名称?

Dha*_*val 7 iphone mac-address ip-address device

我得到设备Mac和IP地址.但是,不要获取设备名称.

任何想法如何获得更多的信息,如可能像设备的"网络实用程序"?

Man*_*ani 12

NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
Run Code Online (Sandbox Code Playgroud)


Dee*_*pak 3

在 iOS 4.1+ 上,您可以执行以下操作:如果您正在查找 SSID 名称..

进口

- (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];
}
Run Code Online (Sandbox Code Playgroud)