Re: NSMetadataQuery can not be synchronous ?
Re: NSMetadataQuery can not be synchronous ?
- Subject: Re: NSMetadataQuery can not be synchronous ?
- From: Chris Kane <email@hidden>
- Date: Fri, 20 May 2005 17:13:15 -0700
On May 20, 2005, at 1:00 AM, Aurélien Hugelé wrote:
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*/
but AFAIK Cocoa's higher level NSMedataQuery API does not offer
this choice, it seems that you can only use asynchronous mode !?
There is no asynchronous mode in NSMetadataQuery, but you can do it
yourself by running the run loop yourself after starting the query,
until you want to stop waiting. That's all that MDQuery does, with
less flexibility.
am i wrong ? why do Apple limit our possibilities here ?
I know that asynchronous is generally better design, but it depends...
Writing the synchronous code around an asynchronous basic API gives
you more flexibility, not less. Though it is less convenient....
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden