这个应用程序运行良好,我多次发布和更新此应用程序.我刚刚从swift2.2迁移到swift 3,现在我收到以下错误:
XCUIApplication仅适用于iOS 9.0或更高版本
我在Info中的iOS部署目标是9.0(见下图)所以我不确定是什么导致了这一点.注意,我可以在模拟器模式和物理设备上构建和运行应用程序(我尝试在iPhone 6和6+上运行,它工作正常).我担心前进而没有解决这个问题.任何帮助/建议将不胜感激.
以下是与此错误相关联的Xcode中*UITests.swift的屏幕抓取(下方)(XCUIApplication仅适用于iOS 9.0或更高版本).
以下代码在我使用swift 2.2发布和更新的应用程序中运行良好.我只是迁移到swift 3,现在我得到以下编译时错误; "使用appendingPathComponent"与行的模糊使用:
let PDFPathFileName = documentDirectory.appendingPathComponent(fileName as String)
Run Code Online (Sandbox Code Playgroud)
在这:
func returnPDFPath() -> String {
let path:NSArray = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) as NSArray
let documentDirectory: AnyObject = path.object(at: 0) as AnyObject
let PDFPathFileName = documentDirectory.appendingPathComponent(fileName as String)
return PDFPathFileName
}
@IBAction func reveiwPDFSendCliked(_ sender: AnyObject) {
let pdfPathWithFileName = returnPDFPath()
generatePDFs(pdfPathWithFileName)
}
Run Code Online (Sandbox Code Playgroud)
此代码负责将文件路径返回到documentDirectory,该文件路径将在用户单击查看并保存PDF按钮时用于保存PDF文件.任何建议将不胜感激.