• 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: How inspect pending performSelectorOnMainThread ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How inspect pending performSelectorOnMainThread ?


  • Subject: Re: How inspect pending performSelectorOnMainThread ?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Mon, 7 Apr 2008 16:59:17 +0200


Le 7 avr. 08 à 16:49, Jens Alfke a écrit :

On 7 Apr '08, at 6:24 AM, Jacob Engstrand wrote:

In a separate thread I call:
[self performSelectorOnMainThread: @selector(broadcastMessage:) withObject: nil waitUntilDone: NO];
Now, is there a way for the main thread to inspect the queue of pending messages, their targets and arguments?

Nope. That information is private to the runloop implementation.

(I would like my unit test to verify that -broadcastMessage: has actually been sent to the main thread.)

You can have a flag that the main thread sets in its - broadcastMessage: method, and the unit test checks afterwards.

And if you do not want to modify your implementation to match a test case, you can use method_exchangeImplementations() (or class posing) in your test to catch the -broadcastMessage: call, set a flag (and then call the original implementation).


_______________________________________________

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


References: 
 >How inspect pending performSelectorOnMainThread ? (From: Jacob Engstrand <email@hidden>)
 >Re: How inspect pending performSelectorOnMainThread ? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: How inspect pending performSelectorOnMainThread ?
  • Next by Date: Re: Objective-C Instance Variable Names
  • Previous by thread: Re: How inspect pending performSelectorOnMainThread ?
  • Next by thread: Is this a bug in Cocoa 'isLike' ?
  • Index(es):
    • Date
    • Thread