-
Notifications
You must be signed in to change notification settings - Fork 208
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? #180
Comments
If you replace the loc with @loc, the code below should work in run_after. You need to use @, because it will create an instance variable in the Ben Taylor 於 2012年12月24日星期一寫道:
|
So why does this work fine with GCD, but not using App.run_after? |
And, if it does work fine with GCD, but not with an NSTimer - doesn't that make a great cause for switching to GCD over the NSTimer? |
This depends on the implementation of the Dispatch. In any case, the loc is Ben Taylor 於 2012年12月24日星期一寫道:
|
Is there something in the RubyMotion docs explaining this? It massively violates the way blocks work in Ruby.
On Tuesday, 25 December 2012 at 12:19 AM, Francis Chong wrote:
|
That is not the reason of choosing GCD vs NSTimer. Generally GCD is a lower Ben Taylor 於 2012年12月24日星期一寫道:
|
No that's fine. I'm more concerned about the fact that you're claiming blocks are no longer closures. |
I don't sure are there any official documentation about this. But yes, the Ben Taylor 於 2012年12月24日星期一寫道:
|
Refer this blog.blazingcloud.net/2012/07/16/rubymotion-block-scope-bug/ It should have been fixed. I remember I've encountered some similar issue Ben Taylor 於 2012年12月24日星期一寫道:
|
About this issue, would you please create a test case that reproduce it? Ben Taylor 於 2012年12月24日星期一寫道:
|
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:
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.
The text was updated successfully, but these errors were encountered: