enum和typedef enum 在IOS中的使用
来源:互联网 发布:hadoop超市数据分析 编辑:程序博客网 时间:2024/05/18 00:35
第一、typedef的使用
C语言里typedef的解释是用来声明新的类型名来代替已有的类型名,typedef为C语言的关键字,作用是为一种数据类型定义一个新名字。这里的数据类型包括内部数据类型(int,char等)和自定义的数据类型(struct等)
如:typedef char gender;
gender a;与char a;语句相同。
第二 、enum的使用
enum是枚举类型,
如:
enum AlertTableSections
{
kUIAction_Simple_Section = 1,
kUIAction_OKCancel_Section,
kUIAction_Custom_Section,
kUIAlert_Simple_Section,
kUIAlert_OKCancel_Section,
kUIAlert_Custom_Section,
};
kUIAction_OKCancel_Section的值为2.
给枚举类型变量赋值需转换:mytablesection = (enum AlertTableSection)5;
第三、typedef enum 的使用
typedef
typedef enum {
UIButtonTypeCustom = 0, // no button type
UIButtonTypeRoundedRect, // rounded rect, flat white button, like in address card
UIButtonTypeDetailDisclosure,
UIButtonTypeInfoLight,
UIButtonTypeInfoDark,
UIButtonTypeContactAdd,
} UIButtonType;
UIButtonType表示一个类别,它的值只能是UIButtonTypeCustom....
- enum和enum typedef 在IOS中的使用
- enum和enum typedef 在IOS中的使用
- enum和typedef enum 在IOS中的使用
- enum和enum typedef 在IOS中的使用
- C - enum和typedef enum的使用
- iOS开发之 typedef enum 和enum的用法
- enum 和 typedef
- enum 和 typedef
- enum和typedef分析
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum 在c中的使用
- enum在switch中的使用
- Linux中SVN服务器安装与使用以及windows客户端的使用(CentOS-6.5)
- 为 YUM 源配置优先级
- Python实现设置终端显示颜色、粗体、下划线等效果
- 取数游戏
- linux基础命令
- enum和typedef enum 在IOS中的使用
- tyvj 1684(状态压缩dp)
- soj 4421 laobi与回文子串
- 黑马程序员 --------------Java概述
- I.MX6Q(TQIMX6Q/TQE9)学习笔记——新版BSP之kernel移植
- redis源码解析----epoll的使用
- 快发组件让网站编辑效率提升4倍-逐浪CMS编辑助手(浏览器插件)发布
- RHEL 6.5 下安装oracle11G
- 2015/5/2日-月总结