Not knowing much about your code, I can't tell you the exact problem, however:
At the top, you differentiate between two different arrays depending on the value of searching
. Later, you only use the array you'd use when searching
is false, with the same index, which seems to be an array of NSDictionary
s, not NSString
s. You also seem to be accessing it using indexPath.section
the first time, and indexPath.row
the second time.
The line I'm talking about, in particular, is this one:
if ([[listOfItems objectAtIndex:indexPath.row] isEqual:@"neon"]){
Based on the previous code, that is, this line:
NSDictionary *dictionary = [listOfItems objectAtIndex:indexPath.section];
I'm guessing that listOfItems
contains a number of items equal to the number of sections in your table view, not the number of rows in the section you clicked in, and I'm also guessing that the return value will never be equal to @"neon"
because it is an NSDictionary
.