iOS更新文件可以在设备的"设置"->"通用"->"存储空间"中找到,可以选择删除。是一段代码,可以用来清理iOS设备上的更新文件:
iOS更新文件可以在设备的"设置"->"通用"->"存储空间"中找到,可以选择删除。
是一段代码,可以用来清理iOS设备上的更新文件:
// 获取iOS设备上的更新文件
NSString *updatePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Updates"];
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:updatePath error:nil];
// 遍历更新文件,删除
for (NSString *file in files) {
NSString *filePath = [updatePath stringByAppendingPathComponent:file];
BOOL success = [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
if (success) {
NSLog(@"删除成功");
} else {
NSLog(@"删除失败");
}
}
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(87条)