I am filtering NSArray using NSPredicate and using a filtered array for my UITableView. I use this filtering when a user enters text in a UITextField. Therefore, every time the text in the UITextField changes, I call the filter function.
It looks like this:
NSArray *hugeArray = ...; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name == %@", input]; _resultArray = [hugeArray filteredArrayUsingPredicate:predicate]; [_myTableView reloadData];
When I use NSArray with a lot of objects, the input becomes very slow (full input in the user interface becomes slow). Is it possible to get better performance or run a filtered command in the background?
Writing anything in a UITextField should not be blocked. When the UITableView is updated in a very short time after input, this may be normal.
source share