首页 > 其他 > 详细

本地文件

时间:2018-10-24 19:09:35      阅读:98      评论:0      收藏:0      [点我收藏+]

 

 

本地文件

-(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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!