当前位置:编程学习 > 网站相关 >>

打开网站Url连接

-(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] ] ];
 
}
补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,