复合语句在 Objective-C 中的使用
2016-03-18 09:57
471 查看
1、一般写一个
2、复合语句的使用
tableView的写法
self.myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)) style:UITableViewStyleGrouped]; self.myTableView.dataSource = self; self.myTableView.delegate = self; [self.view addSubview:self.myTableView];
2、复合语句的使用
self.myTableView = ({ UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)) style:UITableViewStyleGrouped]; tableView.dataSource = self; tableView.delegate = self; [self.view addSubview:tableView]; tableView; });
相关文章推荐
- Object 转 json 工具类
- Objective-C中谓词(NSPredicate)的应用
- Object对象之equals方法
- QT操作Excel(通过QAxObject使用了OLE,前提是本地安装了Excel)
- DOM (Document Object Model)文档对象模型
- 利用JsonObject解析Json数据
- Gson 解析时候报错: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
- BOM (Browser Object Model) 浏览器对象模型
- Objective-C中的集合类
- iOS开发系列--Objective-C之协议、代码块、分类
- Java Object有哪些公用方法?
- objective c关于下划线和双下划线的用法
- iOS开发实用技巧—Objective-C中的各种遍历(迭代)方式
- iOS 中C如何调用Objective c的代码更新界面问题解决
- 论文阅读笔记:You Only Look Once: Unified, Real-Time Object Detection
- Can not add Newtonsoft.Json.Linq.JValue to Newtonsoft.Json.Linq.JObject.
- Parcelable encountered ClassNotFoundException reading a Serializable object bug解析
- Objective-C的Method Swizzle、对象模型、消息机制、消息转发的详解
- enumerateObjectsUsingBlock
- 从Map、JSONObject取不存在键值对时的异常情况