tableView简化写法
来源:互联网 发布:淘宝助理设置快递模板 编辑:程序博客网 时间:2024/06/05 06:30
#import "MyTableViewController.h"@interface MyTableViewController ()@property(nonatomic,retain)NSMutableArray *arr;@end@implementation MyTableViewController- (void)viewDidLoad { [super viewDidLoad]; self.arr = [NSMutableArray arrayWithObjects:@"宋江", @"卢俊义", @"吴用", @"公孙胜", @"关胜", @"林冲", @"秦明" ,@"呼延灼" , @"花荣",@"柴进", @"李应", @"朱仝",@"鲁智深",@"武松", @"徐宁", @"张清", @"杨志", @"董平", @"索超", @"戴宗", @"刘唐", @"李逵", @"史进", @"穆弘", @"雷横", @"李俊",nil]; ////tableView的对cell的注册 [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuse"]; self.refreshControl=[[UIRefreshControl alloc] init]; [self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];}-(void)refresh:(UIRefreshControl *)control{ NSLog(@"11111");}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}#pragma mark - Table view data source- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1;}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.arr.count;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuse" forIndexPath:indexPath]; cell.textLabel.text=self.arr[indexPath.row]; return cell;}
0 0
- tableView简化写法
- 简化delegate写法
- 简化delegate写法
- Android 简化findViewById写法
- android findviewbyId 简化写法
- 汇编程序的简化写法
- 封装tableView、collectView,简化使用
- 简化ui文件转换写法
- JDK7的try简化写法
- iOS DataSource从tableview分离 简化viewController
- 求最大公约数和最小公倍数—简化写法
- 简化只执行一次的写法
- ViewHolder的另一种简化的巧妙写法
- ormlite使用中的dao简化写法
- Android-View自定义属性-简化写法
- makefile的命名和写法简化
- makefile的命名和写法简化
- Python简化类例五:实现链式写法
- 关于java中的操作符
- C# 获取CPU序列号、网卡MAC地址、硬盘序列号封装类,用于软件绑定电脑
- Java进阶(五十三)屡试不爽之正则表达式
- 21.UINavigationController和UINavigationBar的使用小技巧
- vga 与 asf 同步播放
- tableView简化写法
- ubuntu14.04 mysql用户权限操作实录
- Android SDK Manager国内无法更新的解决方案
- Saltstack内置state模块file之managed
- python 20151227
- GC基本算法及C++GC机制
- iOS面试题8
- Saltstack内置state模块file之append
- Linux必学的60个命令