当前位置

网站首页> 程序设计 > 开源项目 > 编程语言 > 浏览文章

FileDelete

作者:小梦 来源: 网络 时间: 2024-02-12 阅读:

程序员必上的开发者服务平台 —— DevStore

FileDelete 是简单的 iOS 类,可以从文档和库目录删除文件和子目录。

使用需要引入:

[FileDelete deleteFileFromDocumentsDirectory:@"helpme" inSubDirectory:nil];[FileDelete deleteFileFromLibraryDirectory:@"helpme" inSubDirectory:@"help/theworld];[FileDelete deleteSubDirectoryFromDocumentsDirectory:@"helpless"];[FileDelete deleteSubDirectoryFromLibraryDirectory:@"Libraryofhelplessness/mine"];

Swift 版本方法:

// Delete filesFileDelete.deleteFileFromDocumentsDirectory("YourFile.extension",subdirectory:"YourDirectory")FileDelete.deleteFileFromLibraryDirectory("YourFile.extension",subdirectory:"YourDirectory")FileDelete.deleteFileFromApplicationSupportDirectory("YourFile.extension",subdirectory:"YourDirectory")FileDelete.deleteFileFromTemporaryDirectory("YourFile.extension",subdirectory:"YourDirectory")FileDelete.deleteFileFromCachesDirectory("YourFile.extension",subdirectory:"YourDirectory")// Delete foldersFileDelete.deleteSubDirectoryFromDocumentsDirectory("YourDirectory")FileDelete.deleteSubDirectoryFromLibraryDirectory("YourDirectory")FileDelete.deleteSubDirectoryFromApplicationSupportDirectory("YourDirectory")FileDelete.deleteSubDirectoryFromTemporaryDirectory("YourDirectory")FileDelete.deleteSubDirectoryFromCachesDirectory("YourDirectory")


相关阅读

热点阅读

网友最爱