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

  • Home
  • SEARCH
  • 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 8206039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:30:55+00:00 2026-06-07T08:30:55+00:00

I have a UISearchBar and whenever I begin typing in it I get the

  • 0

I have a UISearchBar and whenever I begin typing in it I get the following crash report


[__NSCFDictionary rangeOfString:options:]: unrecognized selector sent to instance 0x6a9d210
2012-07-10 14:46:52.956 MinePedia[275:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary rangeOfString:options:]: unrecognized selector sent to instance 0x6a9d210'
*
First throw call stack:
(0x11f9052 0x15d5d0a 0x11faced 0x115ff00 0x115fce2 0xaad2 0x4754b2 0x11faec9 0x242515 0x2e872f 0x2e7e1e 0x2f4ce9 0x30112a 0xbf3a39 0x11c4885 0x11c47a8 0xb381aa 0x40a88e7 0x34b3917 0x3877111 0x387a4e1 0x408385b 0x40862e3 0x4086440 0x408301d 0x3869df0 0x3869ee3 0x4087119 0x388284d 0x3882b32 0x3896e12 0x3dfc0f7 0x3895245 0x38941f2 0x38948fb 0x3dfbca4 0x38a964e 0x38970a0 0x3879a0a 0x34e4ad9 0x11fae72 0x40a35bc 0x350b7f9 0x350d87f 0x3dfe03 0x3a3792 0x3a4944 0x3a36b6 0x3acf09 0x24e406 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x32c14a 0x24e460 0x24e0c5 0x24e1f8 0x241aa9 0x2172fa9 0x11cd1c5 0x1132022 0x113090a 0x112fdb4 0x112fccb 0x2171879 0x217193e 0x23fa9b 0x22f8 0x2255)
terminate called throwing an exceptionCurrent language: auto; currently objective-c
(gdb)

My SearchTableViewController.h file:

#import <UIKit/UIKit.h>

@interface SearchTableViewController : UITableViewController <UISearchBarDelegate> {

    NSMutableArray *serversArray;
    NSMutableArray *modsArray;
    NSMutableArray *pluginsArray;

    NSMutableArray *allItemsArray;
    NSMutableArray *displayItemsArray;

    IBOutlet UISearchBar *theSearchBar;
}
@end

and My SearchTableViewController.m file:

#import "SearchTableViewController.h"


@implementation SearchTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

     // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    modsArray = [[NSMutableArray alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://21zach2.webs.com/iPhone/MinePedia/Plists/TopRated/Mods.plist"]];
    serversArray = [[NSMutableArray alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://21zach2.webs.com/iPhone/MinePedia/Plists/TopRated/Servers.plist"]];
    pluginsArray = [[NSMutableArray alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://21zach2.webs.com/iPhone/MinePedia/Plists/TopRated/Plugins.plist"]];

    allItemsArray = [[NSMutableArray alloc] init];
    displayItemsArray = [[NSMutableArray alloc] init];

    [allItemsArray addObjectsFromArray:modsArray];
    [allItemsArray addObjectsFromArray:serversArray];
    [allItemsArray addObjectsFromArray:pluginsArray];

    [displayItemsArray addObjectsFromArray:allItemsArray];

}

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

    if ([searchText length] == 0) {
        [displayItemsArray removeAllObjects];
        [displayItemsArray addObjectsFromArray:allItemsArray];
    } else {
        [displayItemsArray removeAllObjects];
        for (NSString *string in allItemsArray) {
            NSRange range = [string rangeOfString:searchText options:NSCaseInsensitiveSearch];
            if (range.location != NSNotFound) {
                [displayItemsArray addObject:string];
            }
        }
    }
    [self.tableView reloadData];

}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {

    [searchBar resignFirstResponder];
    [theSearchBar resignFirstResponder];

}

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {

    [theSearchBar resignFirstResponder];
    [searchBar resignFirstResponder];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [displayItemsArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // Configure the cell...
    cell.textLabel.text = [[displayItemsArray objectAtIndex:indexPath.row] objectForKey:@"name"];
    return cell;
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    /*
     <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     */
}

@end

I am using storyboard. I cant upload pictures due to lack of reputation so I cant show you what my variables are linked to.

  • 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-07T08:31:01+00:00Added an answer on June 7, 2026 at 8:31 am

    Your allItemsArray contains dictionaries, not strings. You need to get the string value out that you want to search for, for example, if it was the string stored under the key “name”:

    for (NSDictionary *item in allItemsArray) { 
        NSString *string = [item objectForKey:@"name"];            
        NSRange range = [string rangeOfString:searchText options:NSCaseInsensitiveSearch]; 
        if (range.location != NSNotFound) { 
            [displayItemsArray addObject:item]; 
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UISearchBar which I am putting in UISearchDisplayController. Now, whenever I tap
I have a UISearchBar and UISearchDisplayController, everything works great but my scope selector displays
I have an UISearchBar in the header view of my table. Whenever an animation
I have a UISearchBar in my app, and I'm running the following code with
I have a UISearchBar which uses the UIScopeBar, and I am trying to get
I have a simple UISearchBar with a cancel button. When I call the following:
I have the following UISearchbar code: - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { [UIApplication sharedApplication].networkActivityIndicatorVisible
I have the following code for my UISearchBar: UISearchBar * searchBar = [[UISearchBar alloc]
I have uisearchbar in a uiview which is already subview of a uiviewController, I
I have a UISearchbar with delegate method - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { if(searchText.length>3){

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.