随机数
随机取0-100
arc4random() % 101
随机取80+(0至20)
(arc4random() % 21) +80;
随机字符串
-(NSString *)ret32bitString { //随机生成n位字母 int n=4;
char data[n]; for (int x=0;x<n;data[x++] = (char)('A' + (arc4random_uniform(26)))); return [[NSString alloc] initWithBytes:data length:n encoding:NSUTF8StringEncoding]; }