UIWebView未在ios中加载

时间:2016-12-21 11:25:09

标签: ios objective-c storyboard payumoney

NSURL *url = [NSURL URLWithString: address];
NSString *body = [NSString stringWithFormat: @"%@", webViewString];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
[_paymentWebView loadRequest: request];

我加载了UIWebView,但是当我尝试通过上面代码中的UIWebView访问 PayUMoney 支付网关时,我的应用程序出现此错误,但它显示此错误并且我正在使用{ {1}}在其他API调用中。 请帮我解决这个错误。

  

objc [4933]:类PLBuildVersion在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices中实现(0x12487e998)和/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices(0x1246a3d38)。将使用两者之一。哪一个未定义。**

2 个答案:

答案 0 :(得分:0)

只需使用

NSURL *url = [NSURL URLWithString: address];
NSString *body = [NSString stringWithFormat: @"%@", webViewString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_paymentWebView loadRequest: request];

您无需使用 setHTTPBody setHTTPMethod

答案 1 :(得分:0)

您拥有的代码不是我们应该如何在webview中加载网址。

如下所示,简单易用的方法是在UIWebView中加载URL。

NSURL *websiteUrl = [NSURL URLWithString:@"http://www.google.com"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:websiteUrl];
[myWebView loadRequest:urlRequest];