我正在将代码从Objective-C转换为Swift3,并且在编写这段代码时leturl=URL(string:"http://example.com/index.html")varformattedURL:String=url!.resourceSpecifier我收到错误消息“'resourceSpecifier'不可用:请改用path、query和fragment”。我该如何解决这个问题? 最佳答案 你可以桥接URL到NSURLleturl=URL(string:"http://example.com/index.html")