1.cube escape在ios怎么设置中文?
2.CFStringRef是什么编程语言
3.CFStringRefåNSString
4.怎样获取wifi列表
5.å¦ä½è·åwifiå表
cube escape在ios怎么设置中文?
cube escape在ios设置中文的办法:使用CFStringRef的方法:
sUrl = (NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)sUrl, nil, nil, kCFStringEncodingUTF8);
使用NSString的方法:
NSString* string2 = [string1stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString* string1 = [string2stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]。
CFStringRef是login登录源码什么编程语言
CFStringRef,应该是根目录浏览源码iOS或MacOS App下用到的东西,隶属于CoreFundation框架,pubglite无后座源码该框架由苹果公司掌管。app免费UI源码
CFStringRef是商户资料采集源码一个内部指向CFString对象的一个引用。
使用该结构的语言有:C++,Objective-C,Swift
CFStringRefåNSString
CFStringRef a = CFSTR("a");
NSString *b = @"b";
ä¸ãCFSTRæ¯ä¸ä¸ªå®ï¼è¿ä¸ªå®çå®ä¹å¯è½æ¯CFStringMakeConstantStringï¼ä¹å¯è½æ¯__builtin___CFStringMakeConstantStringãå¦ææ¯CFStringMakeConstantStringï¼ççCFStringMakeConstantStringçå®ç°å°±ä¼æç½ï¼CFSTR("a")æ¯åæ¾å¨ä¸ä¸ªå ¨å±åå ¸éé¢çï¼ä¸æ¬¡ç¨å°CFSTR("a")çæ¶åå æ¥åå ¸éé¢æ没æï¼å¦ææå°±æ¯ç¨åå¨çï¼å¦æ没æååé ä¸ä¸ªï¼å¹¶ä¸æ¾å°åå ¸éé¢ãæ以è¿éæ两个éè¦æ³¨æç:
1ãCFSTRåé åºæ¥çå符串对象æ¯ä¸è½èªå·±éæ¾çï¼å¦æä½ éæ¾äºä¸æ¬¡å¨ä½¿ç¨å°±ä¼ä½¿ç¨å°ä¸ä¸ªé对象ï¼
2ãå¤çº¿ç¨ä½¿ç¨å¯è½ä¼åºé®é¢ï¼å ä¸ºå ¨å±çåå ¸æ¯æ²¡æéçã
äºãèNSStringç@æäºä¸ä¸æ ·ï¼åºè¯¥å__builtin___CFStringMakeConstantStringæäºç±»ä¼¼ï¼å è®¸ä½ å¤çº¿ç¨ä½¿ç¨ï¼åæ ·ä¹ä¸éè¦ä½ èªå·±å»releaseï¼å¯ä»¥ç解为bæ¯ä¸ä¸ªautoreleaseç对象ï¼ç³»ç»ä¼èªå·±èªå¨æ¶åbãå¦ææ³é¿æ¶é´ææbé£å°±retainï¼ä½ä¸è¦å¿äºreleaseã
ä¸ãç¸äºè½¬æ¢
CFStringRef aCFString = (CFStringRef)aNSString;
NSString *aNSString = (NSString *)aCFString;
怎样获取wifi列表
只能获取当前的SSID
- (id)fetchSSIDInfo
{
NSString *currentSSID = @"";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil){
NSDictionary* myDict = (__bridge NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict!=nil){
currentSSID=[myDict valueForKey:@"SSID"];
} else {
currentSSID=@"<<NONE>>";
}
} else {
currentSSID=@"<<NONE>>";
}
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge id)CNCopyCurrentNetworkInfo((CFStringRef)CFBridgingRetain(ifnam));
if (info && [info count]) {
break;
}
}
return info;
}
å¦ä½è·åwifiå表
åªè½è·åå½åçSSID
- (id)fetchSSIDInfo
{
NSString *currentSSID = @"";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil){
NSDictionary* myDict = (__bridge NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict!=nil){
currentSSID=[myDict valueForKey:@"SSID"];
} else {
currentSSID=@"<<NONE>>";
}
} else {
currentSSID=@"<<NONE>>";
}
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge id)CNCopyCurrentNetworkInfo((CFStringRef)CFBridgingRetain(ifnam));
if (info && [info count]) {
break;
}
}
return info;
}