I am trying to search through a few thousand objects in my iPhone app, however the search lags badly – after each keystroke the UI freezes for 1 – 2 seconds. To prevent this, I have to execute the search on a background thread.
I was wondering whether anyone had some tips for searching on a background thread? I read a little into NSOperation and searched the web, but didn’t really find anything useful.
Try using an
NSOperationQueueas an instance variable in your view controller.