Skip to content

Instantly share code, notes, and snippets.

@dmarkow
Created August 29, 2012 03:35
Show Gist options
  • Save dmarkow/3506545 to your computer and use it in GitHub Desktop.
Save dmarkow/3506545 to your computer and use it in GitHub Desktop.
Broken performSelector:withObject:afterDelay in RubyMotion 1.22
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
test_perform_selector
true
end
def test_perform_selector
foo = "bar"
foo.retain # Crashes without this
wait_1_second do
puts foo
foo.release # Crashes without this
end
end
def wait_1_second(&block)
performSelector("run_block:", withObject:block, afterDelay:1.0)
end
def run_block(block)
block.call
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment