Created
June 14, 2010 11:18
-
-
Save igaiga/437564 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
UIButton* button = [[[UIButton alloc] initWithFrame:CGRectMake(150, 240, 100, 30)] autorelease]; | |
[button setBackgroundImage:[UIImage imageNamed:@"btn.png"] | |
forState:UIControlStateNormal]; | |
[button setBackgroundImage:[UIImage imageNamed:@"btn_on.png"] | |
forState:UIControlStateHighlighted]; | |
[button addTarget:self action:@selector(button_pushed) forControlEvents:UIControlEventTouchUpInside]; | |
[self.view addSubview:button]; | |
- (IBAction) button_pushed { | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" message:@"Safariを起動して地図を表示します。よろしいですか?" delegate:self cancelButtonTitle: nil otherButtonTitles:@"Safariを起動", @"キャンセル", nil]; | |
[alertView show]; | |
[alertView release]; | |
} | |
// AlertViewDelegate | |
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { | |
if(buttonIndex == 0 ) { | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://igarashikuniaki.net/tdiary/"]]; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment