2016-12-21 72 views
0
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支付網關在上面的代碼,但它表明這個錯誤,我在使用AFNetworking其他API調用。 請幫我解決這個錯誤。UIWebView的iOS中不加載

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)。將使用兩者之一。哪一個是不確定的。**

+1

此錯誤不與webview相關。 – Poles

+0

請參考:http://stackoverflow.com/questions/39521667/class-plbuildversion-is-implemented-in-both-applications –

回答

0

只需使用

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

你並不需要使用setHTTPBodysetHTTPMethod

+0

感謝您的迴應。以及我在哪裏傳遞** body **字符串在webview – Mathi

+0

它實際上包含什麼? – Poles

+0

如果你想傳遞一些參數,那麼你必須通過追加來傳遞它。 – Poles

0

您擁有的代碼並不是我們應該如何在webview中加載url。

簡單明瞭的方法如下,在UIWebView中加載URL。

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