Note that there are some explanatory texts on larger screens.

plurals
  1. POsearch dont work well (use storyBoard, coreData)
    primarykey
    data
    text
    <p>I add search bar follow tutorial but in some reason the search dont show me results.</p> <p>note: I add "self tableView" in line 2 to avoid error. maybe this is the problem? or the problem with the IF?</p> <p><strong>git: <a href="https://github.com/dennis87/git_bookList" rel="nofollow">https://github.com/dennis87/git_bookList</a></strong></p> <p>I think the problem is in this code:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; //cell create if (nil == cell) { UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } if (tableView == self.searchDisplayController.searchResultsTableView) { NSLog(@"Configuring cell to show search results"); Books *book = [[self searchResults]objectAtIndex:indexPath.row]; [[cell textLabel]setText:[book title]]; } else { NSLog(@"Configuring cell to show normal data"); Books *book = [[self fetchResultsController]objectAtIndexPath:indexPath]; [[cell textLabel]setText:[book title]]; } return cell; } </code></pre> <p>I tried put NSlogs and get that this NSLog never printed, so maybe the problems is with the IF? what I do wrong?</p> <pre><code>- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { NSLog(@"Previous Search Results were removed."); [self.searchResults removeAllObjects]; for (Books *book in [self.fetchResultsController fetchedObjects]) { if ([scope isEqualToString:@"All"] || [book.title isEqualToString:scope]) { NSLog(@"entered"); NSComparisonResult result = [book.title compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { NSLog(@"Adding book.title '%@' to searchResults as it begins with search text '%@'", book.title, searchText); [self.searchResults addObject:book]; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload