0

ユーザーが検索テキストフィールドにデータを入力すると、一致するレコードがtableViewに表示されるようにしたいtableView表示コンテンツを持つiPadがあります。

- (void)onSearchButtonClick 
 {   

 if (searchTextField.text == nil || searchTextField.text.length == 0) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"You must fill the text to search first!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
    return;
}

  [searchTextField resignFirstResponder];
}

通常、tableView に表示されるのは次のとおりです。

     - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {




   static NSString *CustomCellIdentifier = @"CustomCellIdentifier";

       CustomCell *cell = (CustomCell *)[tableView 

                                  d      equeueReusableCellWithIdentifier: CustomCellIdentifier];

  if (cell == nil)  
      {


    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" 
                                                 owner:self options:nil];
    for(id oneObject in nib)
        if ([oneObject isKindOfClass:[CustomCell class]])
            cell = (CustomCell *)oneObject;

    cell.selectionStyle=UITableViewCellSelectionStyleNone;


}


      appDelegate = (MultipleDetailViewsWithNavigatorAppDelegate *)[[UIApplication sharedApplication] delegate];

ObjectData*obj;


    obj=[appDelegate.detailArray objectAtIndex:indexPath.row];



type=obj.contentType;

content_Type=obj.contentType;

content_Source=obj.contentSource;
    cell.text=Content_Source;


   return cell;
  }

検索がクリックされたときに、レコードと一致してtableViewに表示されるようにしたい

4

2 に答える 2