• 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: performSelector in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelector in Swift


  • Subject: Re: performSelector in Swift
  • From: Roland King <email@hidden>
  • Date: Fri, 11 Jul 2014 12:39:14 +0800

> On 11 Jul 2014, at 11:48 am, Gerriet M. Denkmann <email@hidden> wrote:
>
> Swift has this method:
> 	+cancelPreviousPerformRequestsWithTarget:selector:object:
> which "Cancels perform requests previously registered with performSelector:withObject:afterDelay:."
>
> But performSelector:withObject:afterDelay: seems NOT to exist in Swift (no Swift code in documentation).
>
> The Swift with Obj-C book says: “The performSelector: method and related selector-invoking methods are not imported in Swift because they are inherently unsafe.”
>
> So: what is the point of cancelPreviousPerformRequestsWithTarget in Swift?

Probably an oversight, file a bug on it.


>
> What to do when porting code which uses performSelector?
>
> There are several places where one needs to use performSelector:withObject:afterDelay:0 to execute something as soon as possible, but NOT in this event loop. How to do this in Swift?
>

People still use that to hop event loops? You’ll be telling me there are still coders doing manual retain release next. :)

dispatch_* has been the API for async perform and delays for a while now. It’s queue-based and not runloop based, but rarely is that a problem.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: performSelector in Swift
      • From: Quincey Morris <email@hidden>
References: 
 >performSelector in Swift (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: performSelector in Swift
  • Next by Date: Re: performSelector in Swift
  • Previous by thread: Re: performSelector in Swift
  • Next by thread: Re: performSelector in Swift
  • Index(es):
    • Date
    • Thread