1

我无法访问存储在 Swift Playgroundbook 的 PrivateResources 文件夹中的子目录中的图像。我正在尝试访问以下图像。我试过Bundle.main.path(forResource: "img_1", ofType: "jpg", inDirectory: "trainingSample/0"), Bundle.main.urls(forResourcesWithExtension: "jpg", subdirectory: "trainingSample/0")Bundle(for: type(of: self)).path(forResource: "trainingSample", ofType: nil)但它们都返回空数组或 nil。有人可以帮我吗?提前致谢!我正在尝试访问的图像

4

0 回答 0