On May 6, 2016, at 14:58 , Alex Zavatone <z...@mac.com> wrote: > > Can we come up with a suitable set of tests to replicate and verify this
This was the code from the forum thread that I played around with: > class ViewController: UIViewController { > let backgroundQueue = dispatch_queue_create("backgroundQueue", > DISPATCH_QUEUE_SERIAL); > var tickTimer: NSTimer? > > var cancelTimer: NSTimer? > > override func viewDidLoad() { > super.viewDidLoad() > > tickTimer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, > selector: "timerFired:", userInfo: nil, repeats: true) > > cancelTimer = NSTimer.scheduledTimerWithTimeInterval(30, target: > self, selector: "cancelTimerFired:", userInfo: nil, repeats: false) > } > > func timerFired(timer: NSTimer) { > for _ in 0..<100 { > > dispatch_async(backgroundQueue, { () -> Void in > // TODO: some calculation. However, it does not matter > }) > } > } > > func cancelTimerFired(timer: NSTimer) { > tickTimer?.invalidate() > } > } But it only be a problem with specific OS X or iOS versions. I haven’t checked lately. _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com