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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:26:07+00:00 2026-06-10T11:26:07+00:00

I found this perfect answer to search through an NSFetchedResultsController : https://stackoverflow.com/a/4481896/1486928 EDIT :

  • 0

I found this perfect answer to search through an NSFetchedResultsController : https://stackoverflow.com/a/4481896/1486928

EDIT : project showing the issue : http://cl.ly/2x0C0N0E4240

It seems really great except it wasn’t written to use with ARC, I tried to just remove all the “retain” “release” “autorelease”.

It still works, well mostly, the thing is, when I enter a char in the searchbar it shows the filtered table as expected but it only takes 1 char (if you add more it doesn’t do anything) and after that every other “search” will show the results of the first search that only took 1 char.

I’ve been at it for 2 days putting NSlog anywhere to see when every methods are called but still couldn’t find how to make it work 🙁

Thanks !

Edit : here is .m http://pastebin.com/9U4TfbA6
Edit : here is .h http://pastebin.com/S9aaNRFE

Also if it can help the search works when I comment this :

- (NSFetchedResultsController *)fetchedResultsController {
    if (fetchedResultsController_! = nil)
    {
        return fetchedResultsController_;
    }
...
}

And this :

- (NSFetchedResultsController *)searchFetchedResultsController { 
    if (searchFetchedResultsController_ != nil)
    {
        return searchFetchedResultsController_;
    }
...
}

But it mess up other things :/

  • 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-10T11:26:08+00:00Added an answer on June 10, 2026 at 11:26 am

    I guess that you are messing up with the search display controller delegate methods,

    and especially you need to check this method

    - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString;
    

    Because this method will reload your table view for every character which you type in your search field as the name itself suggests shouldReloadTableForSearchString

    Edit:

    Well you need to implement 2 delegate methods of UISearchBar because all your UISearchDisplayController delegate methods are same and those 2 methods are

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

    This tells the delegate that the user changed the search text.

    - (BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text 
    

    This is used if the text in a specified range should be replaced with given text.

    and please note these methods are called several times, i mean for the every character added and deleted in the search bar and because you are setting the searchFetchedResultsController to nil every time the search text changes

    just comment out this part, it will work well

    /*if (searchFetchedResultsController_ != nil)
    {
    NSLog(@"Returned !nil searchController");
    return searchFetchedResultsController_;
    }*/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this jQuery plugin online that shows and hides divs. It's perfect for
I actually posted this question because I found similar questions but not a perfect
EDIT: I finally found a real simple solution to this problem, using the CAGradientLayer
Found this while reading the Neo4j manual, specifically here , I found the sentence:
Found This: tyty stack, Social Icons not working with Infinite Scrolling on Wordpress I'm
found this little code snippet that seems to do what i want, but im
Found this Multimap containing pairs? , but it is not much help How would
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even

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.