Created
April 10, 2012 23:11
-
-
Save tomohisa/2355465 to your computer and use it in GitHub Desktop.
Check and open Twitter URL Scheme
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
NSString *str = [NSString stringWithFormat:@"twitter://user?screen_name=%@", bstr]; | |
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:str]]) { | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; | |
}else { | |
UIAlertView*alert = [[UIAlertView alloc] initWithTitle:@"Tweetoverview" message:NSLocalizedString(@"Can not open twitter app. Please install twitter app to send tweet.", @"Can not open twitter app. Please install twitter app to send tweet.") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; | |
[alert show]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment