iOS 随笔小技巧 弱self 打印当前类行数列数,多人开发自动适配pch地址,获取设备uid的信息
$(SRCROOT)/PrefixHeader.pch自动适配pch地址
__weak __block typeof(self) weakself = self;
__weak typeof(self)weakSelf = self;
#define DN_DEBUG_LOG(fmt, ...)
{NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }
NSDictionary *ifs = [self fetchSSIDInfo];
//NSString *ssid = [[ifs objectForKey:@"SSID"] lowercaseString];
NSString *ssid =ifs[@"SSID"];
NSLog(@"ifs --%@ , wifi设备名称--%@",ifs,ssid);
- (id)fetchSSIDInfo {
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
//NSLog(@"Supported interfaces: %@", ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
//NSLog(@"%@ => %@", ifnam, info);
if (info && [info count]) { break; }
}
return info;
}
//这句是支持汉字url编译
// NSString *strdn = [urlstr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];