设置tableView的数据源方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return _array.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //创建cell static NSString *ID = @"txl"; UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:ID]; if (cell == nil) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:ID]; } //设置cell数据 lxrModel *lxrMdl = _array[indexPath.row]; cell.textLabel.text = lxrMdl.name; cell.detailTextLabel.text = lxrMdl.num; return cell;
全身心修练iOS