iOS 跳转到应用所在的App Store市场

时间:2022-04-26
本文章向大家介绍iOS 跳转到应用所在的App Store市场,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

代码入下

#import "ViewController.h"

@interface ViewController ()<UIWebViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //添加webView
    UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.bounds];
    webView.delegate = self;
    webView.backgroundColor = [UIColor redColor];
    [self.view addSubview: webView];
    
    NSString *string=@"https://itunes.apple.com/us/app/yao-ba/id1062767832?l=zh&ls=1&mt=8";
    
    NSURL *url = [NSURL URLWithString:string];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    

    [webView loadRequest:request];
}
-(void)webViewDidStartLoad:(UIWebView *)webView
{
    NSLog(@"kaishi ");
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSLog(@"完成");
}