gpt4 book ai didi

ios - objective-c 从 iOS 设备上的 wifi 点获取 mac 地址,但在地址中看不到零

转载 作者:可可西里 更新时间:2023-11-01 05:52:57 27 4
gpt4 key购买 nike

我用函数看看

BSSID = "d4:ca:6d:d4:e:89";
SSID = "ExtremeFitness_FreeInternet";
SSIDDATA = <45787472 656d6546 69746e65 73735f46 72656549 6e746572 6e6574>;

但 mac 地址来自 wifi 指针 d4:ca:6d:d4:0e:89

之后,我将当前的 wifi bssid 与数据库中的 mac 地址进行比较,比较 NSString

为什么我在此代码中看不到 0?

+(NSString *) getMac{

CFArrayRef myArray = CNCopySupportedInterfaces();
CFDictionaryRef captiveNetWork = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
//NSLog(@"Connected at : %@", captiveNetWork);
NSDictionary *myDictionnary = (__bridge NSDictionary *)captiveNetWork;
NSString *bssid = [myDictionnary objectForKey:@"BSSID"];

if (bssid.length == 0) {

return @"";
}

return bssid;
}

-(void)compareMacAddress{

for (int i = 0; i < _clubs.count; i ++) {


NSString *macFromClub = [[NSString stringWithFormat:@"%@", _clubs[i][@"mac"]] lowercaseString];

NSLog(@"%@", _clubs[i]);

EFMacAddressUtil *macUtil = [[EFMacAddressUtil alloc] init];

NSLog(@"%@", [[macUtil getMac] lowercaseString]);

NSRange range = [macFromClub rangeOfString:[[macUtil getMac] lowercaseString]];

if (range.length > 0) {

[_clubInfo setObject:_clubs[i][@"address"] forKey:@"address"];
[_clubInfo setObject:_clubs[i][@"id"] forKey:@"id"];
[_clubInfo setObject:_clubs[i][@"ip"] forKey:@"ip"];
[_clubInfo setObject:_clubs[i][@"mac"] forKey:@"mac"];

_inClub = true;

[_mainOfficeTableView reloadData];
break;

}else{

_inClub = false;

[_mainOfficeTableView reloadData];
}
}

最佳答案

解决了如果我的应用程序在 mac 地址 xx:xx:xx:e:xx:xx 中看到我创建字符串 xx:xx:xx:0e:xx:xx

关于ios - objective-c 从 iOS 设备上的 wifi 点获取 mac 地址,但在地址中看不到零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28059042/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com