Created
January 23, 2013 03:08
-
-
Save gfodor/4601521 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@view = UIButton.alloc.initWithFrame([[0,0],[150,150]]) | |
@view.backgroundColor = UIColor.redColor | |
window.addSubview(@view) | |
@count = 0 | |
window.makeKeyAndVisible | |
@view.addTarget(self, action:"tapped", forControlEvents:UIControlEventTouchUpInside) | |
temp_fields[:foo] = "foo" | |
true | |
end | |
def temp_fields | |
@fields ||= {} | |
end | |
def tapped | |
foo = temp_fields[:foo] | |
temp_fields[:foo] = nil # comment out this line to stop crash | |
puts foo | |
temp_fields[:foo] = "foo" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment