При запуске приложения он сначала загружается, а затем загружает веб-страницу в сафари. Как я могу сделать загрузку страницы в UIWebView
и иметь внешние ссылки в webView
в сафари?Открывайте ссылки WebView в Safari
Вот некоторые из Кодекса webviewcontroller.m -
#import "WebViewController.h"
@implementation WebViewController
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Initialization code
}
return self;
}
/*
If you need to do additional setup after loading the view, override viewDidLoad. */
- (void)viewDidLoad {
NSString *urlAddress = @"url link goes here";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
[[UIApplication sharedApplication] openURL:url];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webView loadRequest:requestObj];
}
@end