如何让UIWebView加载网页,但URL是否在UILabel上?

Jam*_*son 0 iphone xcode encoding uiwebview ios

如何让UIWebView加载网页,但URL在UILabel上?我知道它的所有编码,但我如何使用以下代码!

NSString *urlAddress = //####### THIS SHOUL BE EQUAL TO MY LABEL URL #######//
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
Run Code Online (Sandbox Code Playgroud)

Nek*_*kto 7

您可以获取text类的属性UILabel来访问其值:

UILabel *label;
NSString *urlAddress = label.text;
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
Run Code Online (Sandbox Code Playgroud)