Jon*_*son 4 safari openurl uiactionsheet ios
我正在尝试使用操作表打开带有链接的safari.变量设置正确并相应地显示链接,但由于某种原因,Safari将无法打开,我无法弄清楚为什么...
这是代码:
-(void)actionSheet {
sheet = [[UIActionSheet alloc] initWithTitle:@"Options"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Open in Safari", nil];
[sheet showInView:[UIApplication sharedApplication].keyWindow];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != -1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.url]];
}
}
Run Code Online (Sandbox Code Playgroud)
Har*_*ora 15
NSString *strurl = [NSString stringWithFormat:@"http://%@",strMediaIconUrl];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strurl]];
use http:// must.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9673 次 |
| 最近记录: |