On May 20, 2005, at 4:00 AM, Aurélien Hugelé wrote:
Hi list !
most of my code is currently using MDQueryRef. I have a crash somewhere in MDQueryExecute() with very few informations. I suspect an Apple bug, but i'm not sure...
Trying to fix my bug, i want to use NSMetadataQuery instead of low level MDQueryRef (because i'm maybe doing something wrong ?)
with MDQueryRef, you can make the query synchronous, i mean block until all results are found, using
if( !MDQueryExecute(outboxQuery,kMDQuerySynchronous)) // /*kMDQueryWantsUpdates if you want asynchronous mode*/
NSMetadataQuery is built on top of MDQuery, so you'll not gain anything significant by using NSMetadataQuery.
but AFAIK Cocoa's higher level NSMedataQuery API does not offer this choice, it seems that you can only use asynchronous mode !?
that is correct.
am i wrong ? why do Apple limit our possibilities here ?
No possibilities limited.. You can use MDQuery directly instead.
I know that asynchronous is generally better design, but it depends...