if (NSClassFromString(@"SKStoreProductViewController")) {
SKStoreProductViewController *storeProductVC = [[SKStoreProductViewController alloc] init];
storeProductVC.delegate = self;
NSDictionary *dict = [NSDictionary dictionaryWithObject:app_id
forKey:SKStoreProductParameterITunesItemIdentifier];
[storeProductVC loadProductWithParameters:dict completionBlock:^(BOOL result, NSError *error) {
if (result) {
[self presentViewController:storeProductVC animated:YES completion:nil];
}
}];
}else{
NSString *iTunesLink =[NSString stringWithFormat:@"http://itunes.apple.com/app/id%@?mt=8",appId];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
}
在iOS7上生成错误Cannot connect to iTunes Store
。