Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>for one thing, please condense your code so we don't have to scroll through all the newlines. Furthermore, is this the dataSource of your table view, and if so, where are:</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath </code></pre> <p>they have to access copyListOfItems, which may fail and be the source of your crash.</p> <p>What does the console show when it crashes?</p> <p><strong>edit:</strong> thanks for providing the extra info. Your problem lies here:</p> <pre><code>for (NSString *sTemp in searchArray) </code></pre> <p>searchArray contains "waitsup" objects, I think, not <code>NSString</code>. You cast it to an <code>NSString</code> pointer, but it's your responsibility that it actually points to an <code>NSString</code> object. Therefore you get the error that <code>rangeOfString</code> is called on a <code>waitsup</code>, which is "unrecognized". You cannot then call <code>rangeOfString</code> on the waitsup object, if you didn't provide the rangeOfString method in it yourself.</p> <p>Looking at the rest of your code, I think you could fix it like this:</p> <pre><code>for (waitsup *sTemp in searchArray) { NSRange titleResultsRange = [sTemp.name_last rangeOfString:searchText options:NSCaseInsensitiveSearch]; if (titleResultsRange.length &gt; 0) [copyListOfItems addObject:sTemp]; } </code></pre> <p>but then only <code>name_last</code> is searched. Expanding this to include more fields is trivial.</p>
 

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