Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should App.run_after use GCD? #179

Closed
taybenlor opened this issue Dec 24, 2012 · 1 comment
Closed

Should App.run_after use GCD? #179

taybenlor opened this issue Dec 24, 2012 · 1 comment

Comments

@taybenlor
Copy link

I'm currently spicing up one of my RubyMotion apps with BubbleWrap. A little bit of code I have works fine with GCD but crashes using App.run_after. My knowledge of the Objective C threading model and Timers vs GCD is limited, so I'm not sure whether this would break a bunch of existing code.

Anyway, my example:

    loc = @mapView.region.center

    Dispatch::Queue.main.after 0.4 do 
      new_loc = @mapView.region.center
      if loc == new_loc
        self.updateLocation
      end
    end

The change to BubbleWrap would be super quick, though I haven't made the change and tested it. Just wanted to check it was a sane thing to do.

@taybenlor
Copy link
Author

Duplicate of #180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant