Guest User

Untitled

a guest
Dec 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1.  
  2. class AppDelegate
  3. def application(application, didFinishLaunchingWithOptions:launchOptions)
  4. test_perform_selector
  5. true
  6. end
  7.  
  8. def test_perform_selector
  9. foo = "bar"
  10. foo.retain # Crashes without this
  11. wait_1_second do
  12. puts foo
  13. foo.release # Crashes without this
  14. end
  15. end
  16.  
  17. def wait_1_second(&block)
  18. performSelector("run_block:", withObject:block, afterDelay:1.0)
  19. end
  20.  
  21. def run_block(block)
  22. block.call
  23. end
  24. end
Add Comment
Please, Sign In to add comment