Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:38:33+00:00 2026-06-06T19:38:33+00:00

Edited code – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @Cell;

  • 0

Edited code

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
   if (cell==nil) 
    cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];


if (isFiltered) {
   int rowCount=indexPath.row;
   Aves *filtrada=[filteredTableData objectAtIndex:rowCount];
   cell.textLabel.text=filtrada.name;
   NSLog(@"mostrando: ");
    }else {
        int rowCounter=indexPath.row;
        Aves *author=[theauthors objectAtIndex:rowCounter];
        cell.textLabel.text=author.name;
    }
NSLog(@"mostrando: ");
return cell;

}

-(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)text
{
    if(text.length == 0)
    {
        isFiltered = FALSE;
    }
    else
    {
        isFiltered = true;
        int i;
        [filteredTableData removeAllObjects];
        for(i=0;[theauthors count]>i;i++)
        {
          Aves *name=[theauthors objectAtIndex:i];
            //NSLog(name.name);
            NSRange nameRange = [[name.name lowercaseString] rangeOfString:[text lowercaseString]];
            if(nameRange.length>0)
            {
                [filteredTableData addObject:name];
                NSLog(name.name);
            }
        }
        [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    }
}

Edit: After working on it a while I solved some problems.Just updated my code, the problem is the repaint of the tableView, every thing else go ok. Check it and give any ideas you have plz ^^

Thx again for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:38:33+00:00Added an answer on June 6, 2026 at 7:38 pm

    finally fixed it. Here is my working code, thx you all =)

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                    reuseIdentifier:CellIdentifier];
    
        if (isFiltered==TRUE) {
            int rowCount=indexPath.row;
            //for (rowCount=0; rowCount<[filteredTableData count]; rowCount++) {
            Aves *filtrada=[filteredTableData objectAtIndex:rowCount];
            cell.textLabel.text=filtrada.name;
            //}
    
        }else if(isFiltered==FALSE) 
        {
            int rowCounter=indexPath.row;
            Aves *author=[theauthors objectAtIndex:rowCounter];
            cell.textLabel.text=author.name;
        }
        return cell; 
    }
    

    -(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)text {

      [filteredTableData removeAllObjects];
    
    filteredTableData=[[NSMutableArray alloc]init ];
    
    if(text.length == 0)
    {
        isFiltered = FALSE;
    }
    else
    {
        isFiltered = TRUE;
        int i;
    
        for(i=0;[theauthors count]>i;i++)
        {
            Aves * filtrado=[[Aves alloc]init];
            filtrado=[theauthors objectAtIndex:i];
            //NSLog(filtrado.name);
            NSRange nameRange = [[filtrado.name lowercaseString] rangeOfString:[text lowercaseString]];
            if(nameRange.length>0)
            {
                [filteredTableData addObject:filtrado];
    
            }
        }
        [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil
    

    waitUntilDone:NO];
    }
    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: Edited javascript code. It's only slightly off now in some columns. Maybe a
I downloaded and edited a code that from internet, basically what I want to
EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM
I have this code that I've edited: http://pastebin.com/vrqHek6S I've put in comments where I
I have this code inside a header (edited): template <int i> class A {};
using Matt's util code (a bit edited for Unicode text) public class GridViewExportUtil {
Edit my code to make it work please. Edited for latest version. Here is
SOLVED. Code has been edited to reflect solution. Given the following GridView : <asp:GridView
I wrote a visual c# 2008 windows form application ,then i edited the code
Update: Edited code example to use AutoA for the workaround (which was the original

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.