By default NSMetaDataQuery
results notifications are received on the main thread. It seems you have to call query.startQuery
on the main thread, but you can use [query.setOperationQueue:]
to set the queue to which results notifications will be sent.
Ideally I want a background thread to be receiving these results and processing them and depending on what files are found, I will set variables or post notifications to the main thread.
What I don't understand is how I create the operational queue and how I process the notification on this queue. Sample code for whatever classes are required and details of where and how they should be created would be great. I have read the Apple docs but can't get my head around how you create a queue that can process notifications.
Thanks