IOS编程教程(十三):如何往表视图(Table View)添加搜索栏(Search Bar)

IOS编程教程(十三):如何往表视图(Table View)添加搜索栏(Search Bar)

IOS编程教程(十三):如何往表视图(Table View)添加搜索栏(Search Bar)

IOS编程教程(十三):如何往表视图(Table View)添加搜索栏(Search Bar)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [recipes count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"RecipeCell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
    }
    
    cell.textLabel.text = [recipes objectAtIndex:indexPath.row];
    return cell;
}

相关文章:

  • 2021-11-18
  • 2022-01-08
  • 2021-10-17
  • 2021-12-06
  • 2022-12-23
  • 2021-08-02
  • 2021-04-08
  • 2021-10-21
猜你喜欢
  • 2021-04-28
  • 2021-12-05
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案