博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
本地文件
阅读量:7005 次
发布时间:2019-06-27

本文共 701 字,大约阅读时间需要 2 分钟。

 

 

本地文件

-(NSMutableDictionary *)localFile {    NSString *path = [[NSBundle mainBundle] bundlePath];    NSFileManager *fm = [NSFileManager defaultManager];    NSDirectoryEnumerator *dirEnum = [fm enumeratorAtPath:path];    NSString *fileName;    NSMutableDictionary *R = [NSMutableDictionary dictionary];    while (fileName = [dirEnum nextObject]) {        NSLog(@"短路径:%@", fileName);        NSLog(@"全路径:%@", [path stringByAppendingPathComponent:fileName]);        if ([fileName hasSuffix:@".png"]) {            NSString *key = [fileName componentsSeparatedByString:@"/"].lastObject;            [R setObject:fileName forKey:key];        }    }    return R;}

 

转载于:https://www.cnblogs.com/OIMM/p/9844921.html

你可能感兴趣的文章