gpt4 book ai didi

IOS WKWebView 文件上传不工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:53:27 26 4
gpt4 key购买 nike

我试图在 WKWebView 中运行一个网络应用程序,在我选择照片库中的图像后,它返回主页并且不上传图像。我收到以下消息:

2018-02-11 14:35:22.870494-0200 网球 [7144:194670] [MC] 从私有(private)有效用户设置中读取。2018-02-11 14:35:44.753840-0200 网球[7144:195114] [发现] 发现扩展时遇到的错误:错误域=PlugInKit 代码=13“查询已取消”UserInfo={NSLocalizedDescription=查询已取消}

我的代码:

import UIKit
import WebKit
class ViewController: UIViewController, UIImagePickerControllerDelegate,UINavigationControllerDelegate {

@IBOutlet weak var webView: WKWebView!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func viewDidAppear(_ animated: Bool) {

let url:URL = URL(string: "http://serivinho:8001/")!
let urlRequest: URLRequest = URLRequest(url: url)
webView.load(urlRequest);
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func dismiss(animated flag: Bool, completion: (() -> Void)?)
{
if self.presentedViewController != nil {
super.dismiss(animated: flag, completion: completion)
}
}
}

我的信息.plist

enter image description here

最佳答案

当我将代码从 viewDidAppear 移动到 ViewDidLoad 时,问题似乎消失了

   override func viewDidLoad() {

let url:URL = URL(string: "http://serivinho:8001/")!
let urlRequest: URLRequest = URLRequest(url: url)
webView.load(urlRequest);
}

我还将目标版本更改为 10.3,并在代码中添加了 WKWebView,而不是在主 Storyboard中。

我仍然收到一些日志消息,但它们并没有阻止工作:

18-02-11 20:25:01.535257-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-02-11 20:25:01.537713-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-02-11 20:25:10.228575-0200 Tennis[406:75090] [Generic] Creating an image format with an unknown type is an error
2018-02-11 20:25:52.676053-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-02-11 20:25:52.676252-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-02-11 20:25:58.340272-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-02-11 20:25:58.340458-0200 Tennis[406:75090] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

关于IOS WKWebView 文件上传不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48733844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com