Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found the problem: it was a simple mistake! What I was doing there was filtering the same array over and over, so, when it got filtered to nothing the first time it hadn't any object anymore. So I just solved by changing the if-else statement as follows:</p> <pre><code>// if (searching) NSPredicate *grammarType; if (section == 1) { NSMutableArray *intermediateResults = [NSMutableArray arrayWithArray:searchResults]; grammarType = [NSPredicate predicateWithFormat:@"type == %@", @"Intermediate"]; [intermediateResults filterUsingPredicate:grammarType]; return [intermediateResults count]; } else if (section == 2) { NSMutableArray *advancedResults = [NSMutableArray arrayWithArray:searchResults]; grammarType = [NSPredicate predicateWithFormat:@"type == %@", @"Advanced"]; [advancedResults filterUsingPredicate:grammarType]; return [advancedResults count]; } else { NSMutableArray *basicResults = [NSMutableArray arrayWithArray:searchResults]; grammarType = [NSPredicate predicateWithFormat:@"type == %@", @"Basic"]; [basicResults filterUsingPredicate:grammarType]; return [basicResults count]; } </code></pre> <p>It was simple, right? ;) Anyway, I still don't have an answer to the second question:</p> <p>“I've noticed that the title headers for the sections, while searching (meaning after I got the search results), don't scroll together with the table as usual, but stay fixed in their places. Instead a copy of them seem to be made and those work the usual way. How is it possible?”</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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