CFUUIDRef和CFStringRef-生成唯一标识符

- (NSString *)createCUID:(NSString *)prefix{

NSString *  result;

CFUUIDRef   uuid;

CFStringRef uuidStr;

uuid = CFUUIDCreate(NULL);

uuidStr = CFUUIDCreateString(NULL, uuid);

result =[NSString stringWithFormat:@"%@-%@", prefix,uuidStr];

CFRelease(uuidStr);

CFRelease(uuid);

return result;

}

希望对你有所帮助!

上一篇:php中用GD绘制折线图


下一篇:HTML5 Canvas玩转酷炫大波浪进度图