Re: Oh notification, where are you?
Re: Oh notification, where are you?
- Subject: Re: Oh notification, where are you?
- From: James Bucanek <email@hidden>
- Date: Wed, 23 Sep 2009 09:18:06 -0700
Michael Thon <mailto:email@hidden> 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@hidden)
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:
This email sent to email@hidden