On 22/09/2009, at 2:31 AM, Michael Thon wrote:

        NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
        [nc addObserver:self
                   selector:@selector(sendNotification:)
                           name:@"NSMetadataQueryDidFinishGatheringNotification"
                         object:nil];
        [myThread start];

In the sendNotification: method I send the notification to the other thread using performSelector: onThread: however sendNotification: is never even called. Either the notifications are not, in fact being sent to the main thread or I'm doing something else wrong. There is probably something basic about threads or notifications that I don't understand but I have run out of ideas about what to try next.


NSMetadataQueryDidFinishGatheringNotification is a string constant, so you should use it directly and not put it inside the @"" string literal container:

        NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
        [nc addObserver:self
                   selector:@selector(sendNotification:)
                           name:NSMetadataQueryDidFinishGatheringNotification
                         object:nil];


--
Rob Keniger



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to