Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

打开网站Url连接

$
0
0

-(IBAction)openWeb{

    NSString *urlText = [ [ NSString stringWithFormat:@"http://ditu.google.cn/"];

    [ [ UIApplication sharedApplication] openURL:[ NSURL urlWithString:urlText];

}

-(IBAction)openWeb{

    NSString *addressText = @"tian an men,bei jing,China";

    addressText = [ addressText stringByAddingpercentEscapesUsingEncoding:NSASCIIStringEncoding];

    NSString *urlText = [ NSString stringWithFormat:@"http://maps.google.com/maps?q = %@",addressText];

    webView.userInteractionEnabled = true;

    [webView loadRequest:[ [ NSURLRequest alloc] initWithURL:[ [ NSURL alloc] initWithString:urlText] ] ];

}

作者:qingsi00 发表于2013-1-16 23:29:51 原文链接
阅读:89 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>