Created
April 23, 2012 04:37
-
-
Save joshdholtz/2468899 to your computer and use it in GitHub Desktop.
iOS - UIButton+Block
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
... | |
[button setAction:kUIButtonBlockTouchUpInside withBlock:^{ | |
NSString* launchUrl = @"http://joshholtz.com"; | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: launchUrl]]; | |
}]; | |
.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wouldn't it cause a retain cycle if you use
self
in the block implementation ?I'm asking because I'm trying to do something like this, and hate for the consumer of the control to always do :