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 8285791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:33:16+00:00 2026-06-08T11:33:16+00:00

i ve got a table view parsed from json string.everthing works good .if i

  • 0

i ve got a table view parsed from json string.everthing works good .if i m to type a character in my search bar i m getting this error '-[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x1d52ac50'below is the code.were the below variable name data is NSMutableArray.could u guys help me out.

- (BOOL)searchDisplayController:(UISearchDisplayController *)controllershouldReloadTableForSearchString:(NSString *)searchString
    {
[searchData removeAllObjects];

NSArray *group;
for(group in nameData)
{
    NSLog(@"wat am i doing here:%@",group);
    NSMutableArray *newGroup = [[NSMutableArray alloc] init];
    NSString *element;

    for(element in group)
    {
        NSRange range = [element rangeOfString:searchString options:NSCaseInsensitiveSearch];

        if (range.length > 0) {
            [newGroup addObject:element];
        }
    }

    if ([newGroup count] > 0) {
        [searchData addObject:newGroup];
    }

}

return YES;
 }
  • 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-08T11:33:17+00:00Added an answer on June 8, 2026 at 11:33 am

    Please check out this code

     - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
    {
        NSMutableArray *array=[[NSMutableArray alloc]init];
        NSDictionary *naming= [self.friendsDictionary objectForKey:@"data"];
        NSLog(@"ggg %@",[self.friendsDictionary objectForKey:@"data"]);
        for(int i =0 ; i< [[self.friendsDictionary objectForKey:@"data"] count]; i++){
            [array addObject:[[[self.friendsDictionary objectForKey:@"data"] objectAtIndex:i] objectForKey:@"name"]];
        }
        NSLog(@"Array %@", array);
    
        if(self.searchDisplayController.searchBar.text.length>0) 
        {
            NSString *strSearchText = self.searchDisplayController.searchBar.text;
            NSMutableArray *group = [[NSMutableArray alloc]init];
            for (int i=0; i<array.count; i++) {
    
                NSString *strData = [array objectAtIndex:i]; 
                  NSLog(@"string Data:%@",strData);
                NSRange rng = [strData rangeOfString:strSearchText options:NSCaseInsensitiveSearch];
                if(rng.location != NSNotFound)
                {
                    if(rng.location== 0)//that is we are checking only the start of the names.
                    {
                        [group addObject:strData]; 
                    }
                }
            }
            if ([group count] > 0) 
            {
        searchData = [[NSMutableArray alloc] init];
                [searchData addObjectsFromArray:group];
                NSLog(@"Sear %@", searchData);
    
            }
        } 
        return YES;
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m parsing a json feed and populating my table view.if my parsed value
I have got a table view which is populated by json webservice url.I am
I'm building an iphone app and I've got a table view with some textfields
I've got a view that has a table view inside. I've got a viewController
I got an iOS app with table view. When i select rows several times,
I've got a detail view that consists of a table view with a few
I've got an app that has a table view that displays contact information in
i have tried the table view sample with the viewcontroller.when im running i got
I've got a view controller, call it VC1, that's a table view. When I
I have a view controller (derived from UIViewController not UITableViewController) containing a table view.

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.