• 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: performSelectorOnMainThread for a selector with a primitive argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelectorOnMainThread for a selector with a primitive argument


  • Subject: Re: performSelectorOnMainThread for a selector with a primitive argument
  • From: Martin Hairer <email@hidden>
  • Date: Thu, 16 Feb 2006 19:56:37 +0000

Is there some solution that I'm completely missing?


You can call objects that take primitive arguments in the main thread by creating an NSInvocation, setting it up to call the method with the primitive, making it retain its arguments, and then invoking the NSInvocation in the main thread.

I wrote a small category for NSObject that does just that. You can simply invoke it by
a call that looks like


[[myObject inMain] mySelectior:arg1 otherarg:arg2];

I found this to be very useful. I can send you the code if you are interested.
Regards,


Martin

HairerSoft
http://www.hairersoft.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >performSelectorOnMainThread for a selector with a primitive argument (From: Eric Crichlow <email@hidden>)
 >Re: performSelectorOnMainThread for a selector with a primitive argument (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Binding lost when using metadataQuery:replacementObjectForResultObject
  • Next by Date: Re: why would anyone want to do that?
  • Previous by thread: Re: performSelectorOnMainThread for a selector with a primitive argument
  • Next by thread: Re: performSelectorOnMainThread for a selector with a primitive argument
  • Index(es):
    • Date
    • Thread