• 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
Oh notification, where are you?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Oh notification, where are you?


  • Subject: Oh notification, where are you?
  • From: Michael Thon <email@hidden>
  • Date: Mon, 21 Sep 2009 18:31:47 +0200

When I instantiate and run an NSMetadataQuery on the main thread I can register for, and receive its notifications, but when I try to run the same code on a separate thread it seems like the notifications are not being delivered. I assumed that NSMetadataQuery was still delivering its notifications on the main thread so I tried to set the window controller as an observer for the query notifications, like so:

	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.

_______________________________________________

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


  • Follow-Ups:
    • Re: Oh notification, where are you?
      • From: Rob Keniger <email@hidden>
    • Re: Oh notification, where are you?
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSURLConnection inserting Accept-Language and Accept headers
  • Next by Date: Re: favicon of address
  • Previous by thread: Job Posting: Experienced Cocoa User Interface Developer (full time position, New York City)
  • Next by thread: Re: Oh notification, where are you?
  • Index(es):
    • Date
    • Thread