Michael Thon <mailto:[email protected]> wrote (Tuesday,
September 22, 2009 11:20 PM +0200):
I did find the problem - my thread needs a runloop in order to
process notifications. Following this fellow's blog post:
http://confuseddevelopment.blogspot.com/2006_10_01_archive.html
I added CFRunLoopRun(); after starting the metadataquery.
Inside the method that gets called to process the notification
I added: CFRunLoopStop(CFRunLoopGetCurrent ()); to stop the runloop.
Michael,
Just for the record, notifications don't need run loops.
Notifications are delivered synchronously in the thread that
posted the notifications. The exceptions are distributed
notifications and notification queues.
However, the code that was generating the notification might
have needed a run loop (which could explain why it was never
generated), and the -performSelector:... family *definitely*
needs a run loop as it queues a deferred message to a run loop's
input source.
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]