• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMetadataQuery can not be synchronous ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSMetadataQuery can not be synchronous ? (From: Aurélien Hugelé <email@hidden>)

  • Prev by Date: Re: Lots of NSTimers?
  • Next by Date: Re: AddressBook-like TextFields?
  • Previous by thread: Re: NSMetadataQuery can not be synchronous ?
  • Next by thread: NSMetadataQuery can not be synchronous ?
  • Index(es):
    • Date
    • Thread