Socket
套接字(socket)是一个抽象层,应用程序可以通过它发送或接收数据,可对其进行像对文件一样的打开、读写和关闭等操作。套接字允许应用程序将I/O插入到网络中,并与网络中的其他应用程序进行通信。网络套接字是IP地址与端口的组合。
大部分系统都提供了一组基于TCP或者UDP的应用程序编程接口(API),该接口通常以一组函数的形式出现,也称为套接字(Socket)
平常用的颜色宏大概如下
1
#define RGBHex(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
考虑到蓝湖中获得的十六进制颜色值为#FF0000
,cv时需要先删除#再添加0x
,想省略这部分
C
语言宏中’#’称之为字符串化操作符(Stringizing Operator),它将函数宏的实际参数转换为对应的字符串常量。利用这个特点定义如下的颜色宏
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#define HEXA(COLOR,A) ({ \
char *color = #COLOR;\
NSString *colorString = [NSString stringWithUTF8String:color]; \
colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@""]; \
colorString = [colorString stringByReplacingOccurrencesOfString:@"0x" withString:@""]; \
unsigned int red,green,blue; \
NSRange range; \
range.length = 2; \
range.location = 0; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&red]; \
range.location = 2; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&green]; \
range.location = 4; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&blue]; \
[UIColor colorWithRed:red/255.0f green:green/255.0f blue:blue/255.0f alpha:A]; \
})
#define HEX(COLOR) HEXA(COLOR,1.0)
支持0xFF0000/#FF0000/FF0000
这三种格式
以前想获取应用的 .ipa
文件可以从 iTunes
下载,macOS
上的 iTunes
升级成 12.7
后,无法再获得 .ipa
文件, 而iOS 9
后就不能从 iTools
之类的辅助工具中导出 .ipa
文件。
后面 Apple
官网又提供了一个 12.6.3 的链接
出于好奇心,想试试直接导出.ipa
文件,并重签名安装到未越狱的设备上。
Update your browser to view this website correctly. Update my browser now