iOS随机数
2015-10-16 13:35
253 查看
如果要随机一个[a, b]范围内的整数
arc4random() % (b - a + 1) + a;
定义颜色的宏:#define color arc4random()%256/255.0
arc4random() % (b - a + 1) + a;
定义颜色的宏:#define color arc4random()%256/255.0
相关文章推荐
- iOS categoryde用法以及extension的区别
- GCD学习 dispatch_barrier_async
- Ios学习之popover的使用
- IOS PUSH(ios自学笔记)
- iOS 事件响应链详解(The Responder Chain)
- iOS 3D touch
- xcode中利用iamges.xcassets添加TabbarCtroller中item图标
- iOS之设备型号获取
- iOS对象(字典或数组)转化为JSon字符串
- IOS Post请求与GET请求
- iOS 多线程之GCD使用
- 【iOS】GKPeerPickerController蓝牙设备通讯
- 用CocoaPods做iOS程序的依赖管理
- iOS tintColor解析
- ios 证书装给别人使用
- 解决IOS9的Info.plist问题
- iOS 9 适配中出现 问题
- IOS9适配会遇到的问题
- ios页面传值——代理方法
- 整理 iOS 9 适配中出现的坑