在ios8中从搜索栏过滤UITableView时的重复值

时间:2015-10-17 07:13:03

标签: ios objective-c uitableview

我使用此代码请检查

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Identifier forIndexPath:indexPath];
    NSString *text,*text1;  if (_segment.selectedSegmentIndex==0)
{

if ([tableView isEqual:ResultsTableView])
{

    text = self.results[indexPath.row];

} else
{
keydata  = [sortedKeys objectAtIndex:indexPath.section];
    arrayKey = [[dict objectForKey:keydata] allKeys];


    NSString *yourString = [arrayKey objectAtIndex:indexPath.row];
    text=yourString;
      }


cell.textLabel.text = text; else
{

    if ([tableView isEqual:ResultsTableView])
    {

        text1 = self.results[indexPath.row];

    } else
    {



        keydata1  = [sortedKeys1 objectAtIndex:indexPath.section];
        arrayKey1 = [[dict1 objectForKey:keydata1] allKeys];


        NSString *yourString = [arrayKey1 objectAtIndex:indexPath.row];
        text1=yourString;



    }

    cell.textLabel.text = text1;
return cell;

}

enter image description here

0 个答案:

没有答案